-
Notifications
You must be signed in to change notification settings - Fork 21
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
For-comp with no yield synthesises a .map call #11951
Comments
Isn't that more or less the general issue that assignments ( |
working as specced at https://scala-lang.org/files/archive/spec/2.13/06-expressions.html#for-comprehensions-and-for-loops to everyones chagrin as
https://contributors.scala-lang.org/t/pre-sip-improve-for-comprehensions-functionality/3509/52 is the canonical contributors thread. |
Perhaps scala/scala3#2573 is the canonical epic. |
unlikely to progress in Scala 2. Scala 3 is a different story |
(if it ever were to progress in Scala 2, it would be because it happened in Scala 3 first) |
reproduction steps
Desugar the following:
problem
It effectively desugars to:
expectation
Because there's no
yield
, I expect all.flatMap
and.map
calls to be.foreach
instead. It should desugar to:The text was updated successfully, but these errors were encountered: