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
scala-cli --version
Scala CLI version: 1.2.1
Scala version (default): 3.4.1
Minimized example
traitAtraitBclassCextendsAwithBdeftest(o: AnyRef):Int=
o match {
casec: AwithB=>1
}
println(test(C()))
Output
Compiling project (Scala 3.4.1, JVM (21))
[warn] ./repro.sc:7:15
[warn] with as a type operator has been deprecated; use & instead
[warn] This construct can be rewritten automatically under -rewrite -source 3.4-migration.
[warn] case c: A with B => 1
[warn] ^^^^
Compiled project (Scala 3.4.1, JVM (21))
1
After updating the code:
Compiling project (Scala 3.4.1, JVM (21))
[error] ./repro.sc:7:15
[error] '=>' expected, but identifier found
[error] case c: A & B => 1
[error] ^
Error compiling project (Scala 3.4.1, JVM (21))
Compilation failed
Workaround is to add parenthesis:
casec: (A&B) =>1
Expectation
Rewrite automatically adds parenthesis, or the compiler doesn't require them