Skip to content

Require explicit types for $0 with %union - #833

Open
ydah wants to merge 1 commit into
masterfrom
fix/zero-reference-type
Open

ydah wants to merge 1 commit into
masterfrom
fix/zero-reference-type

Conversation

@ydah

@ydah ydah commented Oct 28, 2026

Copy link
Copy Markdown
Member

$0 incorrectly inherited the last RHS symbol's type through rhs[-1]. Infer types only for positive positions and report the existing missing-type error for untyped $0 when %union is used.

This follows Bison 3.8.2: explicit $<tag>0 and $0 without %union remain valid. Add regression coverage for empty rules, nonempty rules, and midrule actions.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant