From a56bc34fb850a6dca40c4f8562f3cb2d5b69dcc7 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 13 Mar 2015 17:44:04 +0100 Subject: add/strict Add -strict option to do some type checks that are encessary to ensure type soundness, but are stricter than what Scala 2.x enforces. The first such test is the "pattern cannot be uniquely instantiated" problem where we reject a non-variant case subclass of a covariant superclass in a pattern match. The error is now only issued in -struct mode, otherwise it will be a warning. We might move more tests into the same category. This should help the transition. --- tests/pos/variances-local.scala | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/pos/variances-local.scala (limited to 'tests/pos/variances-local.scala') diff --git a/tests/pos/variances-local.scala b/tests/pos/variances-local.scala new file mode 100644 index 000000000..35e395095 --- /dev/null +++ b/tests/pos/variances-local.scala @@ -0,0 +1,7 @@ +class Foo1[+T] { + private[this] type MyType = T +} + +class Foo2[+T] { + protected[this] type MyType = T +} -- cgit v1.2.3