From 984d7f22f8a0909dc870c65bb927094c54f55402 Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Thu, 29 May 2025 16:36:49 -0700 Subject: Implement MapElement for CoopMat (#7159) With this PR, MapElement works for the following signatures: - CoopMat<...>::MapElement(functype(...)); - CoopMat<...>::MapElement(capturing-lambda); - CoopMat<...>::MapElement(not-capturing-lambda); - Tuple,...>::MapElement(functype(...)); - Tuple,...>::MapElement(capturing-lambda); - Tuple,...>::MapElement(not-capturing-lambda); --- source/slang/slang-lower-to-ir.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-lower-to-ir.cpp') diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index 758b21e93..bc00eb531 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -1191,6 +1191,13 @@ top: lowered = extractField(context, boundMemberInfo->type, base, fieldDeclRef); goto top; } + else if (auto methodDeclRef = declRef.as()) + { + auto funcVal = emitDeclRef(context, declRef, boundMemberInfo->type); + SLANG_RELEASE_ASSERT(funcVal.flavor == LoweredValInfo::Flavor::Simple); + lowered = funcVal; + goto top; + } else { @@ -4584,7 +4591,8 @@ struct ExprLoweringVisitorBase : public ExprVisitor else if (auto callableDeclRef = declRef.as()) { RefPtr boundMemberInfo = new BoundMemberInfo(); - boundMemberInfo->type = nullptr; + boundMemberInfo->type = + lowerType(context, getResultType(context->astBuilder, callableDeclRef)); boundMemberInfo->base = loweredBase; boundMemberInfo->declRef = callableDeclRef; -- cgit v1.2.3