aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/i1050a.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/neg/i1050a.scala')
-rw-r--r--tests/neg/i1050a.scala29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/neg/i1050a.scala b/tests/neg/i1050a.scala
new file mode 100644
index 000000000..47e2f0c59
--- /dev/null
+++ b/tests/neg/i1050a.scala
@@ -0,0 +1,29 @@
+object Tiark1 {
+ trait A { type L <: Nothing }
+ trait B { type L >: Any}
+ trait U {
+ val p: B
+ def brand(x: Any): p.L = x // error: not final
+ }
+ trait V extends U {
+ lazy val p: A & B = ???
+ }
+ val v = new V {}
+ v.brand("boom!")
+}
+object Tiark2 {
+ trait A { type L <: Nothing }
+ trait B { type L >: Any}
+ trait U {
+ type X <: B
+ val p: X
+ def brand(x: Any): p.L = x // error: not final
+ }
+ trait V extends U {
+ type X = B & A
+ lazy val p: X = ???
+ }
+ val v = new V {}
+ v.brand("boom!"): Nothing
+}
+