From 0480cb2a5902b733145f54fdc238aba7b831396b Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 31 Jan 2016 17:04:02 +0100 Subject: Only final lazy vals can be paths. Reason: They might be overridden by other lazy vals that are not realizable, and therefore risk creating bad bounds. --- tests/neg/i1050.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/neg/i1050.scala') diff --git a/tests/neg/i1050.scala b/tests/neg/i1050.scala index bc906f4f4..99d81c317 100644 --- a/tests/neg/i1050.scala +++ b/tests/neg/i1050.scala @@ -39,7 +39,7 @@ object Tiark1 { trait A { type L <: Nothing } trait B { type L >: Any} trait U { - val p: B + lazy val p: B def brand(x: Any): p.L = x // error: not final } trait V extends U { @@ -53,7 +53,7 @@ object Tiark2 { trait B { type L >: Any} trait U { type X <: B - val p: X + lazy val p: X def brand(x: Any): p.L = x // error: not final } trait V extends U { -- cgit v1.2.3