-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcitype:bug
Milestone
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.
Metadata
Metadata
Assignees
Labels
area:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcitype:bug