File tree 3 files changed +41
-4
lines changed
compiler/src/dotty/tools/dotc/transform/patmat
3 files changed +41
-4
lines changed Original file line number Diff line number Diff line change @@ -619,8 +619,8 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
619
619
else this (hi)
620
620
debug.println(s " $tp exposed to =====> $exposed" )
621
621
exposed
622
- case _ =>
623
- mapOver(t )
622
+ case tp =>
623
+ mapOver(tp )
624
624
}
625
625
}
626
626
@@ -638,8 +638,8 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
638
638
639
639
debug.println(s " $tp exposed to =====> $exposed" )
640
640
exposed
641
- case _ =>
642
- mapOver(t )
641
+ case tp =>
642
+ mapOver(tp )
643
643
}
644
644
}
645
645
Original file line number Diff line number Diff line change
1
+ 30: Pattern Match Exhaustivity: K1
Original file line number Diff line number Diff line change
1
+ object App {
2
+ def main (args : Array [String ]): Unit = {
3
+ trait ModuleSig {
4
+ type U2
5
+ type U1
6
+
7
+ trait FooSig {
8
+ type Type = (U1 & U2 )
9
+ def subst [F [_]](fa : F [Int ]): F [Type ]
10
+ }
11
+
12
+ val Foo : FooSig
13
+ }
14
+ val Module : ModuleSig = new ModuleSig {
15
+ type U1 = Int
16
+ type U2 = Int
17
+
18
+ val Foo : FooSig = new FooSig {
19
+ // type Type = Int
20
+ def subst [F [_]](fa : F [Int ]): F [Type ] = fa
21
+ }
22
+ }
23
+ type Foo = Module .Foo .Type
24
+
25
+ sealed abstract class K [F ]
26
+ final case object K1 extends K [Int ]
27
+ final case object K2 extends K [Foo ]
28
+
29
+ val kv : K [Foo ] = Module .Foo .subst[K ](K1 )
30
+ def test (k : K [Foo ]): Unit = k match {
31
+ case K2 => ()
32
+ }
33
+
34
+ test(kv)
35
+ }
36
+ }
You can’t perform that action at this time.
0 commit comments