diff options
| author | Yong He <yonghe@outlook.com> | 2025-01-29 23:11:06 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-29 23:11:06 -0800 |
| commit | 2ae194d51e15c064c3d905e628f7335de7504e32 (patch) | |
| tree | 6ff8df77913152537d7564499b383c719af732c3 /source/slang/slang-check-decl.cpp | |
| parent | cbcb97a64c0b7b908fc7be565b0d6141d2f1a1f7 (diff) | |
Fix ConstantIntVal::toText when the val is a enum. (#6224)
* Fix ConstantIntVal::toText when the val is a enum.
* Fix comment.
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
| -rw-r--r-- | source/slang/slang-check-decl.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp index d12374d52..7d083e53b 100644 --- a/source/slang/slang-check-decl.cpp +++ b/source/slang/slang-check-decl.cpp @@ -7967,9 +7967,8 @@ void SemanticsDeclBodyVisitor::visitEnumCaseDecl(EnumCaseDecl* decl) initExpr = coerce(CoercionSite::General, tagType, initExpr); // We want to enforce that this is an integer constant - // expression, but we don't actually care to retain - // the value. - CheckIntegerConstantExpression( + // expression. + decl->tagVal = CheckIntegerConstantExpression( initExpr, IntegerConstantExpressionCoercionType::AnyInteger, nullptr, |
