diff options
Diffstat (limited to 'source/slang/slang-syntax.cpp')
| -rw-r--r-- | source/slang/slang-syntax.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/slang/slang-syntax.cpp b/source/slang/slang-syntax.cpp index 9e448a5fa..1d3763299 100644 --- a/source/slang/slang-syntax.cpp +++ b/source/slang/slang-syntax.cpp @@ -851,7 +851,7 @@ FuncType* getFuncType(ASTBuilder* astBuilder, DeclRef<CallableDecl> const& declR List<Type*> paramTypes; auto resultType = getResultType(astBuilder, declRef); auto errorType = getErrorCodeType(astBuilder, declRef); - for (auto paramDeclRef : getParameters(astBuilder, declRef)) + auto visitParamDecl = [&](DeclRef<ParamDecl> paramDeclRef) { auto paramDecl = paramDeclRef.getDecl(); auto paramType = getParamType(astBuilder, paramDeclRef); @@ -875,6 +875,18 @@ FuncType* getFuncType(ASTBuilder* astBuilder, DeclRef<CallableDecl> const& declR } } paramTypes.add(paramType); + }; + auto parent = declRef.getParent(); + if (as<SubscriptDecl>(parent) || as<PropertyDecl>(parent)) + { + for (auto paramDeclRef : getParameters(astBuilder, parent.as<CallableDecl>())) + { + visitParamDecl(paramDeclRef); + } + } + for (auto paramDeclRef : getParameters(astBuilder, declRef)) + { + visitParamDecl(paramDeclRef); } FuncType* funcType = |
