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 {
31773177 def pattern1 (location : Location = Location .InPattern ): Tree =
31783178 val p = pattern2(location)
31793179 if in.isColon then
3180- val isVariableOrNumber = isVarPattern(p) || p.isInstanceOf [Number ]
3180+ val isVariableOrNumber = isVarPattern(p) || p.isInstanceOf [Number ] || isBackquoted(p)
31813181 if ! isVariableOrNumber then
31823182 report.errorOrMigrationWarning(
31833183 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
22 case List (_, rest @ _* ) => rest
33 case List (_, Rest @ _* ) => Rest
44 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