File tree 4 files changed +25
-1
lines changed
compiler/src/dotty/tools/dotc/typer
4 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -934,7 +934,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
934
934
* (x: T) to (x @ (w: T)). This is either `_` or `_*`.
935
935
*/
936
936
def cases (ifPat : => Tree , ifExpr : => Tree , wildName : TermName ) = tree.expr match {
937
- case id : untpd.Ident if (ctx.mode is Mode .Pattern ) && untpd.isVarPattern(id) =>
937
+ case id : untpd.Ident if (ctx.mode is Mode .Pattern ) =>
938
938
if (id.name == nme.WILDCARD || id.name == nme.WILDCARD_STAR ) ifPat
939
939
else {
940
940
import untpd .*
Original file line number Diff line number Diff line change
1
+ -- [E006] Not Found Error: tests/neg/i15784.scala:2:22 -----------------------------------------------------------------
2
+ 2 | case List(_, Rest @ `a`) => Rest // error
3
+ | ^^^
4
+ | Not found: a
5
+ |
6
+ | longer explanation available when compiling with `-explain`
7
+ -- [E006] Not Found Error: tests/neg/i15784.scala:3:22 -----------------------------------------------------------------
8
+ 3 | case List(_, Rest @ A) => Rest // error
9
+ | ^
10
+ | Not found: A
11
+ |
12
+ | longer explanation available when compiling with `-explain`
Original file line number Diff line number Diff line change
1
+ def i15784 = List (42 ) match
2
+ case List (_, Rest @ `a`) => Rest // error
3
+ case List (_, Rest @ A ) => Rest // error
4
+ case _ => ???
Original file line number Diff line number Diff line change
1
+ def i15784 = List (42 ) match
2
+ case List (_, rest @ _* ) => rest
3
+ case List (_, Rest @ _* ) => Rest
4
+ case List (_, `Rest` @ _* ) => Rest
5
+ case _ => ???
6
+
7
+ def i15784_auxiliary = 42 match
8
+ case `type` : Int => `type`
You can’t perform that action at this time.
0 commit comments