summaryrefslogtreecommitdiffstats
path: root/source/slang
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2020-04-14 10:55:10 -0700
committerGitHub <noreply@github.com>2020-04-14 10:55:10 -0700
commitcbdee1b1873ff0b7be887bccfbe5409e1a7ba685 (patch)
tree37ca219c3bb3a939e484c54e53b950bea01b23af /source/slang
parent79f6a0193c3b9f9d7211c03cd90e434347245af6 (diff)
Fix front-end handling of generic static methods (#1319)
* Fix front-end handling of generic static methods The front-end logic that was testing if a member was usable as a static member neglected to unwrap any generic-ness and look at the declaration inside (the parser currently puts all modifiers on the inner declaration instead of the outer generic). The test case included here is not a full compute test so that it only runs the front-end checking logic (where we had the bug). * fixup: tabs->spaces
Diffstat (limited to 'source/slang')
-rw-r--r--source/slang/slang-check-decl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp
index fef24e920..d028ebfe4 100644
--- a/source/slang/slang-check-decl.cpp
+++ b/source/slang/slang-check-decl.cpp
@@ -539,6 +539,9 @@ namespace Slang
bool SemanticsVisitor::isDeclUsableAsStaticMember(
Decl* decl)
{
+ if(auto genericDecl = as<GenericDecl>(decl))
+ decl = genericDecl->inner;
+
if(decl->HasModifier<HLSLStaticModifier>())
return true;