From ec0224edc3a867bbf059e790ad7b2a1a881a0705 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 11 Dec 2023 16:13:32 -0800 Subject: Diagnose for invalid decl nesting + namespace lookup fixes. (#3397) * Diagnose for invalid decl nesting. * Fix. * Fix. * Fix. * Fix `namespace` lookup and `using` resolution. * fix project files. * revert project files. * Enhance namespace syntax, docs. * Fixes. --------- Co-authored-by: Yong He --- source/slang/slang-mangle.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-mangle.cpp') diff --git a/source/slang/slang-mangle.cpp b/source/slang/slang-mangle.cpp index 3111ab132..3f701f385 100644 --- a/source/slang/slang-mangle.cpp +++ b/source/slang/slang-mangle.cpp @@ -40,7 +40,6 @@ namespace Slang void emitNameImpl(ManglingContext* context, UnownedStringSlice str) { Index length = str.getLength(); - // If the name consists of only traditional "identifer characters" // (`[a-zA-Z_]`), then we want to emit it more or less directly. // @@ -360,6 +359,9 @@ namespace Slang DeclRef declRef) { auto parentDeclRef = declRef.getParent(); + if (as(parentDeclRef)) + parentDeclRef = parentDeclRef.getParent(); + auto parentGenericDeclRef = parentDeclRef.as(); if( parentDeclRef ) { -- cgit v1.2.3