You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(sv): evaluate checked tagged members in constant functions #1909
P2: constant evaluation rejects all checked tagged-member accesses, including known active members.
Code inspection: ast/const_functions.rs preserves Expr::Call as ConstExpr::Function; typecheck::eval_const_expr_in_env unconditionally returns None for Callee::Checked. The runtime check wrapper therefore prevents a constant function result from being used as an array bound.
Suggested reproducer from the review (not executed in this follow-up):
Implemented in 3d77a16 on PR #1883. Constant evaluation now checks the active-tag guard before evaluating and resizing the payload. Added coverage for array bounds, signed payloads, nested unions, unselected branches, and inactive/unknown guards.
Validation: analyzer 802 passed / 3 existing ignored plus doctests; tagged backend regressions 68 passed, with the final adjusted shared case passing all 5 configurations; affected-crate Clippy and formatting passed. Verilator 5.052 and Icarus 13.0 still reject tagged-union syntax; the changed case diagnostics were reviewed and both strict retained-report gates pass.
New CI and automatic review are pending. This issue will close when #1883 merges.
Activity
feat(sv): support tagged packed unions
tignear commentedon Oct 24, 2026
Implemented in 3d77a16 on PR #1883. Constant evaluation now checks the active-tag guard before evaluating and resizing the payload. Added coverage for array bounds, signed payloads, nested unions, unselected branches, and inactive/unknown guards.
Validation: analyzer 802 passed / 3 existing ignored plus doctests; tagged backend regressions 68 passed, with the final adjusted shared case passing all 5 configurations; affected-crate Clippy and formatting passed. Verilator 5.052 and Icarus 13.0 still reject tagged-union syntax; the changed case diagnostics were reviewed and both strict retained-report gates pass.
New CI and automatic review are pending. This issue will close when #1883 merges.
feat(sv): support tagged packed unions