Skip to content

Implement tuple_replace_at using delete + insert#15388

Merged
josevalim merged 3 commits into
elixir-lang:mainfrom
gldubc:ls-put-elem-type-2
May 14, 2026
Merged

Implement tuple_replace_at using delete + insert#15388
josevalim merged 3 commits into
elixir-lang:mainfrom
gldubc:ls-put-elem-type-2

Conversation

@gldubc
Copy link
Copy Markdown
Member

@gldubc gldubc commented May 14, 2026

Allows typechecking put_elem

Based on #15383, only the implementation of tuple_replace_at changes.

@gldubc gldubc force-pushed the ls-put-elem-type-2 branch from 0798fb5 to e52da49 Compare May 14, 2026 17:55
@lukaszsamson
Copy link
Copy Markdown
Contributor

Cleaner but won't that be slower? It's not a very common operation so maybe the difference is insignificant in practice

@gldubc
Copy link
Copy Markdown
Member Author

gldubc commented May 14, 2026

I don't think that's slower because delete and insert are quite optimized and do different things. The only thing changing is the handling of :dynamic / gradual which is done twice, but it is probably insignificant indeed

@gldubc gldubc marked this pull request as ready for review May 14, 2026 18:03
@josevalim josevalim merged commit 63708d3 into elixir-lang:main May 14, 2026
15 checks passed
@josevalim
Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

@gldubc gldubc deleted the ls-put-elem-type-2 branch May 15, 2026 17:07
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.

3 participants