Skip to content

Fix invalid type inference on size compare in guards#15324

Merged
josevalim merged 1 commit intoelixir-lang:mainfrom
lukaszsamson:ls-fix-guart-comp-infer
Apr 29, 2026
Merged

Fix invalid type inference on size compare in guards#15324
josevalim merged 1 commit intoelixir-lang:mainfrom
lukaszsamson:ls-fix-guart-comp-infer

Conversation

@lukaszsamson
Copy link
Copy Markdown
Contributor

The PR is addressing invalid edge conditions on size comparisons in guards so equivalent mirrored expressions tuple_size(x) >= 2 and 2 <=tuple_size(x) typecheck correctly

The PR is not addressing

assert typecheck!([x], length(x) < 0, x) == dynamic(list(term()))

which I believe should be none type instead of list

Fixes #15323

@josevalim josevalim merged commit ada2817 into elixir-lang:main Apr 29, 2026
15 checks passed
@josevalim
Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

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.

Invalid type inference from guard expression with <= operator

2 participants