Skip to content

Fix tuple_insert_static crash on non-normalized empty type#15542

Open
lukaszsamson wants to merge 1 commit into
elixir-lang:mainfrom
lukaszsamson:ls-tuple_insert_at-crash
Open

Fix tuple_insert_static crash on non-normalized empty type#15542
lukaszsamson wants to merge 1 commit into
elixir-lang:mainfrom
lukaszsamson:ls-tuple_insert_at-crash

Conversation

@lukaszsamson

Copy link
Copy Markdown
Contributor

This PR makes a minimal change and instead of matching on none type asserts that static component has tuple and returns none() on everything else. Returning badtuple here would be incorrect. A few lines up the decision was made that we are dealing with a proper tuple

is_proper_tuple? = descr_key?(dynamic, :tuple) and tuple_only?(static)

dynamic component is a tuple, static is a non-normalized empty type, for which tuple_only? returns true

Alternative approach would be to normalize empty list/tuple/map components at construction but that's a bigger refactor I would not attempt

Fixes #15541

Assisted-by: Claude Opus 4.8

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

tuple_insert_at crash on gradual type

1 participant