Skip to content

fix bug in spread with unions - #7719

Merged
mccanne merged 1 commit into
mainfrom
fix-spread-bug
Nov 24, 2026
Merged

mccanne merged 1 commit into
mainfrom
fix-spread-bug

Conversation

@mccanne

@mccanne mccanne commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Fix record spread of a union value, which contributed no fields: the value under the union is now spread, as field access does, and a non-record member contributes nothing. The checker now types a spread of a union as the records formed from its members instead of unknown, so later references are checked.

Adds runtime/ztests/expr/spread-union.yaml and documents union spreads in types/record.md.

Fix record spread of a union value, which contributed no fields: the value
under the union is now spread, as field access does, and a non-record member
contributes nothing. The checker now types a spread of a union as the records
formed from its members instead of unknown, so later references are checked.

Adds runtime/ztests/expr/spread-union.yaml and documents union spreads
in types/record.md.
@mccanne
mccanne merged commit f7e3eb6 into main Nov 24, 2026
4 checks passed
@mccanne
mccanne deleted the fix-spread-bug branch November 24, 2026 23:00
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.

2 participants