Skip to content

Commit a2ef665

Browse files
liufengyunmichelou
authored andcommitted
Add test case
1 parent 79c9519 commit a2ef665

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

tests/init/neg/i4031.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
object App {
2+
trait A { type L >: Any}
3+
def upcast(a: A, x: Any): a.L = x
4+
val p: A { type L <: Nothing } = p // error
5+
def coerce(x: Any): Int = upcast(p, x)
6+
7+
def main(args: Array[String]): Unit = {
8+
println(coerce("Uh oh!"))
9+
}
10+
}

tests/init/neg/i50.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class C[T] {
2+
val a: T = method
3+
def method = b
4+
val b: T = a // error
5+
}

0 commit comments

Comments
 (0)