diff options
| author | Yong He <yonghe@outlook.com> | 2024-02-11 01:05:37 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-11 01:05:37 -0800 |
| commit | 4f7d1f44a4b2a5eab2e2dec1edf3a156da78aae3 (patch) | |
| tree | 983b505f39a8e884e8af46ba4b7c1d3e80d708aa /source/slang/slang-ast-builder.cpp | |
| parent | 03cddba97e821c013023d51fb7d3d61a130a2a9f (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.cpp | 4 |
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")); |
