From e004511b5f75bb24df1adec71b005146917afb39 Mon Sep 17 00:00:00 2001 From: Sai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com> Date: Thu, 23 Mar 2023 22:27:30 -0400 Subject: 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 --- source/slang/slang-check-decl.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source') 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()) + 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(checkedFuncExpr)->declRef, DeclCheckState::TypesFullyResolved); auto invokeExpr = subVisitor.constructUncheckedInvokeExpr(checkedFuncExpr, imaginaryArguments); auto resolved = subVisitor.ResolveInvoke(invokeExpr); if (auto resolvedInvoke = as(resolved)) -- cgit v1.2.3