diff options
Diffstat (limited to 'source/slang/mangle.cpp')
| -rw-r--r-- | source/slang/mangle.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/slang/mangle.cpp b/source/slang/mangle.cpp index 721072b82..0625a6f73 100644 --- a/source/slang/mangle.cpp +++ b/source/slang/mangle.cpp @@ -184,6 +184,18 @@ namespace Slang } } + // TODO: this needs to be centralized + RefPtr<GenericSubstitution> getOutermostGenericSubst( + RefPtr<Substitutions> inSubst) + { + for (auto subst = inSubst; subst; subst = subst->outer) + { + if (auto genericSubst = subst.As<GenericSubstitution>()) + return genericSubst; + } + return nullptr; + } + void emitQualifiedName( ManglingContext* context, DeclRef<Decl> declRef) @@ -221,7 +233,7 @@ namespace Slang // There are two cases here: either we have specializations // in place for the parent generic declaration, or we don't. - auto subst = declRef.substitutions.As<GenericSubstitution>(); + auto subst = getOutermostGenericSubst(declRef.substitutions); if( subst && subst->genericDecl == parentGenericDeclRef.getDecl() ) { // This is the case where we *do* have substitutions. |
