You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an example where it would have been convenient to have the directives first.
This doesn't seem to work, using local Scala 2:
skalac -d out -cp "out;../../projects/dotty/library/target/scala-3.7.1/scala3-library_3-3.7.2-RC1-bin-SNAPSHOT-nonbootstrapped.jar" -Ytasty-reader main.scala
main.scala:10: error: value % is not a member of Option[Int]
I did not use my sabbatical year to figure out why.
Sample working operator:
//> using options -Ytasty-reader
//> using dep org.scala-lang:scala3-library_3:3.7.1
///> using dep org.scala-lang:scala3-library_3:3.6.4
package foo.bar
// masking imports allows using `+`
import scala.Predef.{any2stringadd => _, _}
object Main extends App {
println {
//None + None
//Option(42) + Option(27)
Option(42) % Option(27)
}
}
The masking import works for the OP, no idea why.
What also works is "excluding" that conversion using -Xsource-features:
//> using options -Ytasty-reader -Xsource:3 -Xsource-features:any2stringadd
Reproduction steps
Scala 2 version: 2.13.16
Scala 3 version: 3.6.3
Please let me know if scala/scala3 is a better place to post this.
Problem
I'd expect the Scala 2 code to compile.
The text was updated successfully, but these errors were encountered: