Open
Description
Compiler version
main
(and also in Scala 2)
Minimized code
def foo: Unit =
val _root_: String = "abc"
Output
-- [E032] Syntax Error: issues/i17757.scala:2:21 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2 | val _root_: String = "abc"
| ^
| pattern expected
|
| longer explanation available when compiling with `-explain`
Expectation
If you leave out the type, it will compile:
val _root_ = "abc"
So this one with a type annotation should compile as well?
Found together with @jan-pieter @nmcb when working on #18019