diff options
| author | Sai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com> | 2023-03-23 22:27:30 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-23 19:27:30 -0700 |
| commit | e004511b5f75bb24df1adec71b005146917afb39 (patch) | |
| tree | b9d8a41dd2dfb92e5808d643c5a1693c78af839f /source | |
| parent | 6e4eae1050ab9282b460a33a013652c387c1e585 (diff) | |
AD: Fix type checking for higher-order custom derivatives definitions (#2729)
* Fixed type coercion issue with higher-order user defined methods
* Placed associated type lookup method in a loop
* Update high-order-user-defined-derivative.slang
* Revert changes to associated type lookup method
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-check-decl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp index eaab43ef8..6083ce9c0 100644 --- a/source/slang/slang-check-decl.cpp +++ b/source/slang/slang-check-decl.cpp @@ -238,6 +238,9 @@ namespace Slang void visitCallableDecl(CallableDecl* decl) { + for (auto paramDecl : decl->getMembersOfType<ParamDecl>()) + visitTypeExp(paramDecl->type); + visitTypeExp(decl->returnType); visitTypeExp(decl->errorType); } @@ -6916,6 +6919,7 @@ namespace Slang auto ctx = visitor->withExprLocalScope(&scope); auto subVisitor = SemanticsVisitor(ctx); auto checkedFuncExpr = visitor->dispatchExpr(attr->funcExpr, ctx); + visitor->ensureDecl(as<DeclRefExpr>(checkedFuncExpr)->declRef, DeclCheckState::TypesFullyResolved); auto invokeExpr = subVisitor.constructUncheckedInvokeExpr(checkedFuncExpr, imaginaryArguments); auto resolved = subVisitor.ResolveInvoke(invokeExpr); if (auto resolvedInvoke = as<InvokeExpr>(resolved)) |
