File tree 2 files changed +3
-3
lines changed
compiler/src/dotty/tools/dotc/typer
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 {
35
35
36
36
override def typedSelect (tree : untpd.Select , pt : Type )(implicit ctx : Context ): Tree = {
37
37
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 ))
39
40
untpd.cpy.Select (tree)(qual1, tree.name).withType(tree.typeOpt)
40
41
}
41
42
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ object Test {
9
9
x match { case { " 42" .toInt } => () } // ok
10
10
x match { case { Y .toInt } => () } // ok
11
11
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
14
13
}
15
14
}
You can’t perform that action at this time.
0 commit comments