Conversation
josevalim
commented
Sep 27, 2026
| # | ||
| # If the collectable may also be a list, the body may be valid | ||
| # on that path, so we only error when the list path is impossible. | ||
| if empty?(intersection) and :non_empty_list not in into_kinds do |
Member
Author
There was a problem hiding this comment.
I think we can remove the TODO above because I believe it is talking about exactly this case!
josevalim
commented
Sep 27, 2026
Comment on lines
869
to
+873
| cond do | ||
| # A comprehension may concatenate the block an arbitrary number of times. | ||
| # Even if both the initial value and each block are unaligned bitstrings, | ||
| # repeated concatenation may eventually produce an aligned binary. | ||
| bitstring_type?(type) and empty_list_type?(type) -> |
Member
Author
There was a problem hiding this comment.
Let's convert this into a case {bitstring_type?(type), empty_list_type?(type)}.
josevalim
commented
Sep 27, 2026
| [flag], | ||
| ( | ||
| into = if flag, do: [], else: "" | ||
| for(_ <- [1], do: :ok, into: into) |
Member
Author
There was a problem hiding this comment.
This should not type check in the static version. It would type check in the dynamic one.
josevalim
commented
Sep 27, 2026
| ( | ||
| into = if flag, do: [], else: "" | ||
| value = if flag, do: :ok, else: "ok" | ||
| for(_ <- [1], do: value, into: into) |
Member
Author
There was a problem hiding this comment.
I don't think this should type check in the static version either. Because if you write it as value = if !flag, it will fail, and the type system would accept it.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.