From ec4a3a0f4d0b8cccf636d1608896e7cafba9dec0 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 2 Feb 2016 10:21:12 +0100 Subject: Big realizability refactoring Move logic from TypeOps to new file CheckRealizable.scala. Also check realizable fields under strict mode. Check at phase PostTyper rather than Typer to avoid cycles. New tests for imports and deep paths. --- tests/neg/i1050a.scala | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests/neg/i1050a.scala') diff --git a/tests/neg/i1050a.scala b/tests/neg/i1050a.scala index 47e2f0c59..4fea5e3b1 100644 --- a/tests/neg/i1050a.scala +++ b/tests/neg/i1050a.scala @@ -1,12 +1,13 @@ +// i1050 checks failing at refchecks 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 + def brand(x: Any): p.L = x } trait V extends U { - lazy val p: A & B = ??? + lazy val p: A & B = ??? // error: may not override } val v = new V {} v.brand("boom!") @@ -17,11 +18,11 @@ object Tiark2 { trait U { type X <: B val p: X - def brand(x: Any): p.L = x // error: not final + def brand(x: Any): p.L = x } trait V extends U { type X = B & A - lazy val p: X = ??? + lazy val p: X = ??? // error: may not override } val v = new V {} v.brand("boom!"): Nothing -- cgit v1.2.3