Compiler version
3.2.0-RC1-bin-20220527-001bfc3-NIGHTLY
Minimized code
val (_: Int | _: AnyRef) = ??? : AnyRef
When compiled with -source 3.2-migration -rewrite the result is
val (_: Int | _: AnyRef) = ??? : AnyRef: @unchecked
which is syntactically invalid.
Output
-- Error: test.scala:1:39 ------------------------------------------------------
1 |val (_: Int | _: AnyRef) = ??? : AnyRef: @unchecked
| ^
| end of toplevel definition expected but ':' found
Expectation
Rewrite should add parentheses as required.