File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -3177,7 +3177,7 @@ object Parsers {
3177
3177
def pattern1 (location : Location = Location .InPattern ): Tree =
3178
3178
val p = pattern2(location)
3179
3179
if in.isColon then
3180
- val isVariableOrNumber = isVarPattern(p) || p.isInstanceOf [Number ]
3180
+ val isVariableOrNumber = isVarPattern(p) || p.isInstanceOf [Number ] || isBackquoted(p)
3181
3181
if ! isVariableOrNumber then
3182
3182
report.errorOrMigrationWarning(
3183
3183
em """ Type ascriptions after patterns other than:
Original file line number Diff line number Diff line change @@ -2,7 +2,4 @@ def i15784 = List(42) match
2
2
case List (_, rest @ _* ) => rest
3
3
case List (_, Rest @ _* ) => Rest
4
4
case List (_, `Rest` @ _* ) => Rest
5
- case _ => ???
6
-
7
- def i15784_auxiliary = 42 match
8
- case `type` : Int => `type`
5
+ case _ => ???
Original file line number Diff line number Diff line change
1
+ //> using options -Xfatal-warnings
2
+ def foo = 42 match
3
+ case `type` : Int => `type`
You can’t perform that action at this time.
0 commit comments