From 61cb51acaedbe603add8c4af9e390a27f8b33f09 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 12 Feb 2015 11:28:35 +0100 Subject: Disallow refinements of types or methods that do not appear in parent. We planned this for a long time but never implemented it. Instead, we sometimes issued an erro in Splitter, namely if reflection would have been needed to access the member. It turns out that some tests (e.g. neg/t625) fail -Ycheck (we knew that before and disabled) but also fail Pickling because they generate orhpan PolyParams. So rather than patching this up it seems now is a good time to enforce the restriction for real. --- tests/pos/typers.scala | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/pos/typers.scala') diff --git a/tests/pos/typers.scala b/tests/pos/typers.scala index fe11ca602..7f67d2c72 100644 --- a/tests/pos/typers.scala +++ b/tests/pos/typers.scala @@ -88,6 +88,7 @@ object typers { } class Refinements { + trait C { type T; def process(x: T): Int } val y: C { type T; val key: T; def process(x: T): Int } = ??? } -- cgit v1.2.3