summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-overload.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-11-08 10:07:57 -0800
committerGitHub <noreply@github.com>2022-11-08 10:07:57 -0800
commitbf67309454032b4f92d0bc9735b608e56b16882f (patch)
treea321fe7db0b49fa67608b935c1389354a020f59c /source/slang/slang-check-overload.cpp
parentca882a1ef46a5a8bbff50e3a1a6f973e16358634 (diff)
Make `__BuiltinFloatingPointType` conform to `IDifferentiable`. (#2499)
Diffstat (limited to 'source/slang/slang-check-overload.cpp')
-rw-r--r--source/slang/slang-check-overload.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/slang/slang-check-overload.cpp b/source/slang/slang-check-overload.cpp
index 42fab94a6..38754d170 100644
--- a/source/slang/slang-check-overload.cpp
+++ b/source/slang/slang-check-overload.cpp
@@ -1573,10 +1573,15 @@ namespace Slang
{
for (auto item : overloadExpr->lookupResult2.items)
{
+ auto funcType = as<FuncType>(GetTypeForDeclRef(item.declRef, item.declRef.decl->loc));
+ if (!funcType)
+ continue;
+ funcType = as<FuncType>(processJVPFuncType(funcType));
+ if (!funcType)
+ continue;
OverloadCandidate candidate;
candidate.flavor = OverloadCandidate::Flavor::Expr;
- candidate.funcType = as<FuncType>(processJVPFuncType(
- as<FuncType>(GetTypeForDeclRef(item.declRef, item.declRef.decl->loc))));
+ candidate.funcType = funcType;
candidate.resultType = candidate.funcType->getResultType();
candidate.item = LookupResultItem(item.declRef);