Skip to content

Commit 00d4871

Browse files
committed
Add scala#4884 test case
1 parent 865aea2 commit 00d4871

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/pos/i4884.scala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
object Test {
2+
trait A
3+
trait TestConstructor1 { type F[_ <: A] }
4+
trait TestConstructor2[D] { type F[_ <: D] }
5+
6+
val v1: TestConstructor1 => Unit = { f =>
7+
type P[a <: A] = f.F[a] // OK
8+
}
9+
10+
val v2: TestConstructor2[A] => Unit = { f =>
11+
type P[a <: A] = f.F[a] // Error! Type argument a does not conform to upper bound D
12+
}
13+
}

0 commit comments

Comments
 (0)