Skip to content

inference: fix union split handling for custom lattices#60857

Merged
aviatesk merged 1 commit intomasterfrom
avi/fix-mustalias-unionsplit
Jan 29, 2026
Merged

inference: fix union split handling for custom lattices#60857
aviatesk merged 1 commit intomasterfrom
avi/fix-mustalias-unionsplit

Conversation

@aviatesk
Copy link
Member

@aviatesk aviatesk commented Jan 28, 2026

MustAlias has has_extended_unionsplit(::MustAliasLattice) === true so it is treated as a target for union split, but uniontypes does not handle MustAlias specially, causing union split to fail for MustAlias.

This issue is addressed by always applying uniontypes to the result of widenconst(x).
External custom lattice implementations could previously provide their own uniontypes, but it would be cleaner interface design if they just overload widenconst for their custom lattice elements so that it returns Union-type.

`MustAlias` has `has_extended_unionsplit(::MustAliasLattice) === true`
so it is treated as a target for union split, but `uniontypes`
does not handle `MustAlias` specially, causing union split to fail
for `MustAlias`.

This issue is addressed by always applying `uniontypes` to the
result of `widenconst(x)`.
External custom lattice implementations could previously provide
their own `uniontypes`, but it would be cleaner interface design if they

just overload  `widenconst` for their custom lattice elements so that it
returns `Union`-type.
@aviatesk aviatesk requested a review from Keno January 28, 2026 20:40
@aviatesk aviatesk added the backport 1.12 Change should be backported to release-1.12 label Jan 28, 2026
@DilumAluthge DilumAluthge mentioned this pull request Jan 28, 2026
40 tasks
@aviatesk aviatesk added the backport 1.13 Change should be backported to release-1.13 label Jan 28, 2026
@aviatesk aviatesk merged commit d4654bd into master Jan 29, 2026
8 of 12 checks passed
@aviatesk aviatesk deleted the avi/fix-mustalias-unionsplit branch January 29, 2026 11:44
aviatesk added a commit that referenced this pull request Jan 29, 2026
`MustAlias` has `has_extended_unionsplit(::MustAliasLattice) === true`
so it is treated as a target for union split, but `uniontypes` does not
handle `MustAlias` specially, causing union split to fail for
`MustAlias`.

This issue is addressed by always applying `uniontypes` to the result of
`widenconst(x)`.
External custom lattice implementations could previously provide their
own `uniontypes`, but it would be cleaner interface design if they just
overload `widenconst` for their custom lattice elements so that it
returns `Union`-type.
aviatesk added a commit that referenced this pull request Jan 29, 2026
`MustAlias` has `has_extended_unionsplit(::MustAliasLattice) === true`
so it is treated as a target for union split, but `uniontypes` does not
handle `MustAlias` specially, causing union split to fail for
`MustAlias`.

This issue is addressed by always applying `uniontypes` to the result of
`widenconst(x)`.
External custom lattice implementations could previously provide their
own `uniontypes`, but it would be cleaner interface design if they just
overload `widenconst` for their custom lattice elements so that it
returns `Union`-type.
@aviatesk aviatesk mentioned this pull request Jan 29, 2026
43 tasks
@aviatesk aviatesk removed backport 1.12 Change should be backported to release-1.12 backport 1.13 Change should be backported to release-1.13 labels Jan 29, 2026
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