File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ class ReTyper extends Typer {
3535
3636 override def typedSelect (tree : untpd.Select , pt : Type )(implicit ctx : Context ): Tree = {
3737 assert(tree.hasType, tree)
38- val qual1 = typed(tree.qualifier, AnySelectionProto )
38+ // a qualifier cannot be a pattern
39+ val qual1 = typed(tree.qualifier, AnySelectionProto )(ctx.retractMode(Mode .Pattern ))
3940 untpd.cpy.Select (tree)(qual1, tree.name).withType(tree.typeOpt)
4041 }
4142
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ object Test {
99 x match { case { " 42" .toInt } => () } // ok
1010 x match { case { Y .toInt } => () } // ok
1111 x match { case { Y }.toInt => () } // ok
12-
13- // x match { case Y.toInt => () } // compiles but rejected by Ycheck
12+ x match { case Y .toInt => () } // ok
1413 }
1514}
You can’t perform that action at this time.
0 commit comments