summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-constraint.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-06-02 15:31:03 -0700
committerGitHub <noreply@github.com>2023-06-02 15:31:03 -0700
commitc3c1b56ae693ed23804544e929a3447bc921edf6 (patch)
treef1d8f81a42f094729d7091cddd5622b1ff25071b /source/slang/slang-check-constraint.cpp
parent16cd361dd67471bcc355d1b3b72b0b022518088f (diff)
Fix generic param inference through TypeCastIntVal. (#2916)
Diffstat (limited to 'source/slang/slang-check-constraint.cpp')
-rw-r--r--source/slang/slang-check-constraint.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/slang/slang-check-constraint.cpp b/source/slang/slang-check-constraint.cpp
index 42d01a996..f0df78c43 100644
--- a/source/slang/slang-check-constraint.cpp
+++ b/source/slang/slang-check-constraint.cpp
@@ -540,8 +540,12 @@ namespace Slang
// Check if both are integer values in general
if (auto fstInt = as<IntVal>(fst))
{
+ if (auto tc = as<TypeCastIntVal>(fstInt))
+ fstInt = as<IntVal>(tc->base);
if (auto sndInt = as<IntVal>(snd))
{
+ if (auto tc = as<TypeCastIntVal>(sndInt))
+ sndInt = as<IntVal>(tc->base);
auto fstParam = as<GenericParamIntVal>(fstInt);
auto sndParam = as<GenericParamIntVal>(sndInt);