File tree Expand file tree Collapse file tree 4 files changed +29
-2
lines changed
compiler/src/dotty/tools/dotc/transform/patmat Expand file tree Collapse file tree 4 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -594,8 +594,8 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
594
594
595
595
// replace type parameter references with bounds
596
596
val typeParamMap = new TypeMap {
597
- def apply (t : Type ): Type = t match {
598
- case tp : TypeRef if tp.symbol.is( TypeParam ) && tp. underlying.isInstanceOf [TypeBounds ] =>
597
+ def apply (t : Type ): Type = t.dealias match {
598
+ case tp : TypeRef if tp.underlying.isInstanceOf [TypeBounds ] =>
599
599
// See tests/patmat/gadt.scala tests/patmat/exhausting.scala tests/patmat/t9657.scala
600
600
val exposed =
601
601
if (variance == 0 ) newTypeVar(tp.underlying.bounds)
Original file line number Diff line number Diff line change
1
+ 20: Pattern Match Exhaustivity: KInt
Original file line number Diff line number Diff line change
1
+ object App {
2
+ def main (args : Array [String ]): Unit = {
3
+ trait AgeT {
4
+ type T
5
+ def subst [F [_]](fa : F [Int ]): F [T ]
6
+ }
7
+
8
+ type Age = Age .T
9
+
10
+ val Age : AgeT = new AgeT {
11
+ type T = Int
12
+ def subst [F [_]](fa : F [Int ]): F [T ] = fa
13
+ }
14
+
15
+ sealed abstract class K [A ]
16
+ final case object KAge extends K [Age ]
17
+ final case object KInt extends K [Int ]
18
+
19
+ val kint : K [Age ] = Age .subst[K ](KInt )
20
+ def get (k : K [Age ]): String = k match {
21
+ case KAge => " Age"
22
+ }
23
+
24
+ get(kint)
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments