diff options
Diffstat (limited to 'source/slang/slang-ast-type.cpp')
| -rw-r--r-- | source/slang/slang-ast-type.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/source/slang/slang-ast-type.cpp b/source/slang/slang-ast-type.cpp index 18f3f90bc..7cfc6a67a 100644 --- a/source/slang/slang-ast-type.cpp +++ b/source/slang/slang-ast-type.cpp @@ -578,7 +578,19 @@ Val* FuncType::_substituteImplOverride(ASTBuilder* astBuilder, SubstitutionSet s List<Type*> substParamTypes; for (Index pp = 0; pp < getParamCount(); pp++) { - substParamTypes.add(as<Type>(getParamType(pp)->substituteImpl(astBuilder, subst, &diff))); + auto substParamType = as<Type>(getParamType(pp)->substituteImpl(astBuilder, subst, &diff)); + if (auto typePack = as<ConcreteTypePack>(substParamType)) + { + // Unwrap the ConcreteTypePack and add each element as a parameter + for (Index i = 0; i < typePack->getTypeCount(); ++i) + { + substParamTypes.add(typePack->getElementType(i)); + } + } + else + { + substParamTypes.add(substParamType); + } } // early exit for no change... @@ -774,7 +786,18 @@ Val* ConcreteTypePack::_substituteImplOverride( for (Index i = 0; i < getTypeCount(); i++) { auto substType = as<Type>(getElementType(i)->substituteImpl(astBuilder, subst, &diff)); - substElementTypes.add(substType); + if (auto typePack = as<ConcreteTypePack>(substType)) + { + // Unwrap the ConcreteTypePack and add each element as a parameter + for (Index j = 0; j < typePack->getTypeCount(); ++j) + { + substElementTypes.add(typePack->getElementType(j)); + } + } + else + { + substElementTypes.add(substType); + } } if (!diff) return this; |
