Skip to content

Commit 3edd4a0

Browse files
committed
add pdgadt-sub pos test
1 parent 6843cb1 commit 3edd4a0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/pos/pdgadt-sub.scala

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
trait SubBase {
2+
type A0
3+
type B0
4+
type C >: A0 <: B0
5+
}
6+
trait Tag { type A }
7+
8+
type Sub[A, B] = SubBase { type A0 = A; type B0 = B }
9+
10+
def foo(x: Tag, y: Tag, e: Sub[x.A, y.A]) = e.match {
11+
case _: Object =>
12+
val t1: y.A = ??? : x.A
13+
}
14+
15+
def bar(x: Tag, e: Sub[Int, x.A]): x.A = e match {
16+
case _: Object => 0
17+
}
18+
19+
def baz(x: Tag, e: Sub[x.A, Int]): Int = e match {
20+
case _: Object => ??? : x.A
21+
}

0 commit comments

Comments
 (0)