File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -796,7 +796,7 @@ object PatternMatcher {
796
796
val expectedClass = expectedTp.dealias.classSymbol.asClass
797
797
ExplicitOuter .ensureOuterAccessors(expectedClass)
798
798
scrutinee.ensureConforms(expectedTp)
799
- .outerSelect(1 , expectedOuter.tpe.widen )
799
+ .outerSelect(1 , expectedClass.owner.typeRef )
800
800
.select(defn.Object_eq )
801
801
.appliedTo(expectedOuter)
802
802
}
Original file line number Diff line number Diff line change
1
+ trait Common {
2
+ case class Data (a : String )
3
+ }
4
+ object O1 extends Common
5
+ object O2 extends Common
6
+
7
+ object Test {
8
+ def main (args : Array [String ]): Unit = {
9
+
10
+ val data = O2 .Data (" test" )
11
+
12
+ val result = data match {
13
+ case O1 .Data (s) => 1
14
+ case O2 .Data (s) => 2
15
+ case _ => 3
16
+ }
17
+
18
+ assert(result == 2 )
19
+ }
20
+ }
You can’t perform that action at this time.
0 commit comments