## Compiler version `main` (and also in Scala 2) ## Minimized code <!-- This code should be self contained, compilable (with possible failures) and as small as possible. Ideally, we should be able to just copy this code in a file and run `scalac` (and maybe `scala`) to reproduce the issue. --> ```Scala def foo: Unit = val _root_: String = "abc" ``` ## Output ```scala -- [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