summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-constraint.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-check-constraint.cpp')
-rw-r--r--source/slang/slang-check-constraint.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/slang/slang-check-constraint.cpp b/source/slang/slang-check-constraint.cpp
index 12988ebcf..cdffcf004 100644
--- a/source/slang/slang-check-constraint.cpp
+++ b/source/slang/slang-check-constraint.cpp
@@ -741,6 +741,20 @@ namespace Slang
return true;
}
+ } else if(auto fstFunType = as<FuncType>(fst))
+ {
+ if (auto sndFunType = as<FuncType>(snd))
+ {
+ const Index numParams = fstFunType->paramTypes.getCount();
+ if(numParams != sndFunType->paramTypes.getCount())
+ return false;
+ for(Index i = 0; i < numParams; ++i)
+ {
+ if(!TryUnifyTypes(constraints, fstFunType->paramTypes[i], sndFunType->paramTypes[i]))
+ return false;
+ }
+ return TryUnifyTypes(constraints, fstFunType->resultType, sndFunType->resultType);
+ }
}
return false;