summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ast-builder.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-02-11 01:05:37 -0800
committerGitHub <noreply@github.com>2024-02-11 01:05:37 -0800
commit4f7d1f44a4b2a5eab2e2dec1edf3a156da78aae3 (patch)
tree983b505f39a8e884e8af46ba4b7c1d3e80d708aa /source/slang/slang-ast-builder.cpp
parent03cddba97e821c013023d51fb7d3d61a130a2a9f (diff)
Fix type checking around generic array types. (#3568)
Diffstat (limited to 'source/slang/slang-ast-builder.cpp')
-rw-r--r--source/slang/slang-ast-builder.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/slang/slang-ast-builder.cpp b/source/slang/slang-ast-builder.cpp
index ce13ab650..0c30366e8 100644
--- a/source/slang/slang-ast-builder.cpp
+++ b/source/slang/slang-ast-builder.cpp
@@ -338,6 +338,10 @@ ArrayExpressionType* ASTBuilder::getArrayType(Type* elementType, IntVal* element
{
elementCount = getIntVal(getIntType(), elementCountConstantInt->getValue());
}
+ else
+ {
+ elementCount = getTypeCastIntVal(getIntType(), elementCount);
+ }
}
Val* args[] = {elementType, elementCount};
return as<ArrayExpressionType>(getSpecializedBuiltinType(makeArrayView(args), "ArrayExpressionType"));