summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-decl.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-04-02 11:51:36 -0700
committerGitHub <noreply@github.com>2024-04-02 11:51:36 -0700
commitb5f4cf63a8b952731053a0d04af0fc8c946d86f3 (patch)
tree5ff2c4fc31a9c6728d7e0af6b60d9b7c074c7a81 /source/slang/slang-check-decl.cpp
parent251f55c5ec4cb2b7432e71d6ba8adc96700d35c2 (diff)
Allow enum values to be used as generic arguments. (#3874)
* Allow enum values to be used as generic arguments. * Fix constant folding.
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
-rw-r--r--source/slang/slang-check-decl.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp
index 07c8b0cba..aec3b463b 100644
--- a/source/slang/slang-check-decl.cpp
+++ b/source/slang/slang-check-decl.cpp
@@ -5946,6 +5946,11 @@ namespace Slang
return isIntegerBaseType(baseType) || baseType == BaseType::Bool;
}
+ bool SemanticsVisitor::isValidCompileTimeConstantType(Type* type)
+ {
+ return isScalarIntegerType(type) || isEnumType(type);
+ }
+
bool SemanticsVisitor::isIntValueInRangeOfType(IntegerLiteralValue value, Type* type)
{
auto basicType = as<BasicExpressionType>(type);