summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-type.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-08-22 09:43:05 -0700
committerGitHub <noreply@github.com>2022-08-22 09:43:05 -0700
commit393185196ed65a9eeaf9502edbf3dcce87337d81 (patch)
tree91c9fa14ddb21d15e6cedf83f7aa6b649e99db86 /source/slang/slang-check-type.cpp
parent15055d20c143cb398bd3e269541eebf24777390a (diff)
Support compile-time constant int val in the form of polynomials. (#2372)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-check-type.cpp')
-rw-r--r--source/slang/slang-check-type.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/slang/slang-check-type.cpp b/source/slang/slang-check-type.cpp
index b8789dd76..aa2c69126 100644
--- a/source/slang/slang-check-type.cpp
+++ b/source/slang/slang-check-type.cpp
@@ -367,8 +367,15 @@ namespace Slang
{
return leftVar->declRef.equals(rightVar->declRef);
}
+ else if (auto rightPoly = as<PolynomialIntVal>(right))
+ {
+ return right->equalsVal(leftVar);
+ }
+ }
+ if (auto leftVar = as<PolynomialIntVal>(left))
+ {
+ return leftVar->equalsVal(right);
}
-
return false;
}