-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Language Spec: add more details about changes in for comprehension #20271
Labels
Comments
unkarjedy
added
the
stat:needs triage
Every issue needs to have an "area" and "itype" label
label
Apr 26, 2024
Related IntelliJ ticket |
sjrd
added
area:spec
and removed
stat:needs triage
Every issue needs to have an "area" and "itype" label
labels
Apr 29, 2024
sjrd
added a commit
to dotty-staging/dotty
that referenced
this issue
Oct 4, 2024
Since Scala 3.4, a `withFilter` is generated if and only if the generator has the `case` modifier. If it does not, the pattern must be irrefutable.
sjrd
added a commit
to dotty-staging/dotty
that referenced
this issue
Oct 5, 2024
Since Scala 3.4, a `withFilter` is generated if and only if the generator has the `case` modifier. If it does not, the pattern must be irrefutable.
odersky
added a commit
that referenced
this issue
Nov 4, 2024
Since Scala 3.4, a `withFilter` is generated if and only if the generator has the `case` modifier. If it does not, the pattern must be irrefutable. --- Rendered version of the changed section: ![image](https://github.com/user-attachments/assets/5db643ba-35a6-429c-a9b9-a95c363f8e89)
WojciechMazur
pushed a commit
that referenced
this issue
Nov 6, 2024
Since Scala 3.4, a `withFilter` is generated if and only if the generator has the `case` modifier. If it does not, the pattern must be irrefutable. [Cherry-picked 127bb7b]
KacperFKorban
pushed a commit
to dotty-staging/dotty
that referenced
this issue
Nov 20, 2024
Since Scala 3.4, a `withFilter` is generated if and only if the generator has the `case` modifier. If it does not, the pattern must be irrefutable.
KacperFKorban
pushed a commit
to dotty-staging/dotty
that referenced
this issue
Nov 29, 2024
Since Scala 3.4, a `withFilter` is generated if and only if the generator has the `case` modifier. If it does not, the pattern must be irrefutable.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In Scala 2 this code
fails to compile with error
(unless you use better-monadic-for plugin)
In Scala 3, it compiles fine.
I found these related links:
case
. #6448There is a lot of information spread around multiple links, and it's hard to understand current behaviour or current desired behavior (these two proved to be different things)
I couldn't find any section in the language specification which would cover the latest state of affairs (specifically the part about withFilter).
I see "Other Changed Features | Pattern Bindings", but I don't see anything related to
withFilter
.The page mostly mentions how Scala 3 produces warning/error in the code, which would be fine in Scala 2 but not vice versa.
Can you please add more details about
withFilter
.Maybe the page misses something else.
The
withFilter
part attracted my attention due tohttps://youtrack.jetbrains.com/issue/SCL-22274/Destructured-types-are-not-inferred-in-for-comprehension-for-ZIO
UPD
I also found https://scala-lang.org/blog/2024/02/29/scala-3.4.0-and-3.3.3-released.html
Blog posts are helpful and can shed light on many things.
But to be 100% sure about the latest behaviour you need to process them one by one, collecting all the changes and calculating what is relevant and what is not relevant
The text was updated successfully, but these errors were encountered: