Closed
Description
Compiler version
3.7
Minimized code
Per pos/i15784.scala
case `type` : Int => `type`
is not a stable identifier pattern. The variable id happens to be backquoted as required for a keyword.
Output
8 | case `type` : Int => `type`
| ^
|Type ascriptions after patterns other than:
| * variable pattern, e.g. `case x: String =>`
| * number literal pattern, e.g. `case 10.5: Double =>`
|are no longer supported. Remove the type ascription or move it to a separate variable pattern.
It looks like the screws were tightened during a round of syntax torquing. Apparently, the bit to the left of the colon was once taken as a pattern.
Expectation
No warning about good syntax.
The corresponding test on Scala 2 is t8044.scala.