scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

Quasiquotes can't parse mods on first member in template body #8458

Closed scabug closed 6 years ago

scabug commented 10 years ago

Quasiquotes fail to parse following pattern:

<console>:34: error: ';' expected but 'val' found.
       val q"class C { $mods val x = $expr }" = q"class C { val x = 1 }"
                             ^

But there is an easy workaround:

scala> val q"class C { $_ => $mods val x = $expr }" = q"class C { val x = 1 }"
mods: reflect.runtime.universe.Modifiers = Modifiers(, , Map())
expr: reflect.runtime.universe.Tree = 1
scabug commented 10 years ago

Imported From: https://issues.scala-lang.org/browse/SI-8458?orig=1 Reporter: @densh Affected Versions: 2.11.0-RC4

scabug commented 9 years ago

@retronym said: Updating fix-by version to 2.11.5.

SethTisue commented 6 years ago

closing all quasiquotes tickets; see #10755