Skip to content

Commit fbdcf5e

Browse files
committed
Add test for type projections
and fix two other tests
1 parent a24915c commit fbdcf5e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

tests/init/neg/i11572.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class A {
33
def get: X
44
}
55
trait Bounded {
6-
type T >: Cov[Int] <: Cov[String] // error
6+
type T >: Cov[Int] <: Cov[String]
77
}
88
val t: Bounded = new Bounded { // error
99
// Note: using this instead of t produces an error (as expected)

tests/neg/i15569.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,9 @@ def andThenSub[A, B, C](f: A <:< B, g: B <:< C): A <:< C =
3737
type t[X] >: Any <: Nothing // error
3838
val unsound: List[Nothing] = List(5 : Any) : List[t[String]]
3939
(unsound.head : Unit => Unit).apply(())
40+
41+
@main def Test7 =
42+
trait A:
43+
type t >: Any <: Nothing
44+
val unsound: List[Nothing] = List(5 : Any) : List[A#t] // error
45+
(unsound.head : Unit => Unit).apply(())

0 commit comments

Comments
 (0)