Closed
Description
import quoted.Toolbox.Default._
val v = '{ (if true then Some(1) else None).map(v => v+1) }
v.show
will output (in REPL, Dotty 0.12.0):
val res0: String = if (true) scala.Some.apply[scala.Int](1) else scala.None.map[scala.Int](((v: scala.Int) => v.+(1)))
...
The confusing part is scala.None.map[scala.Int](...
, which unless closely inspected suggests that we are calling None.map
instead of (if ...).map
.
Perhaps adding brackets around if expressions that are in this situation (the LHS of a method call) might help?