summaryrefslogtreecommitdiff
path: root/source/slang/slang-mangle.cpp
diff options
context:
space:
mode:
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 )
{