From cbdee1b1873ff0b7be887bccfbe5409e1a7ba685 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Tue, 14 Apr 2020 10:55:10 -0700 Subject: 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 --- source/slang/slang-check-decl.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source') 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(decl)) + decl = genericDecl->inner; + if(decl->HasModifier()) return true; -- cgit v1.2.3