summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-mangle.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-12-11 16:13:32 -0800
committerGitHub <noreply@github.com>2023-12-11 16:13:32 -0800
commitec0224edc3a867bbf059e790ad7b2a1a881a0705 (patch)
tree9c56c3fd2dd11f79f597c152326d555d81414fc3 /source/slang/slang-mangle.cpp
parent12fcffaaaf2d1ffa2eefa680e2d7c9971e38a5db (diff)
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 <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-mangle.cpp')
-rw-r--r--source/slang/slang-mangle.cpp4
1 files changed, 3 insertions, 1 deletions
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<Decl> declRef)
{
auto parentDeclRef = declRef.getParent();
+ if (as<FileDecl>(parentDeclRef))
+ parentDeclRef = parentDeclRef.getParent();
+
auto parentGenericDeclRef = parentDeclRef.as<GenericDecl>();
if( parentDeclRef )
{