We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 74bcfd7 commit d28f147Copy full SHA for d28f147
tests/init/neg/i4031.scala
@@ -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
@@ -0,0 +1,5 @@
+class C[T] {
+ val a: T = method
+ def method = b
+ val b: T = a // error
0 commit comments