From 344215b92d22d2101067d6abd8172ac791a30f09 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 16 Sep 2012 21:13:12 +0200 Subject: SI-6336 Disallows value types in structuralal refinements Structural refinements already have a number of restrictions, e.g. cannot refer to type parameters of enclosing classes. We need to disallow value classes as well. --- test/files/neg/t6336.scala | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/files/neg/t6336.scala (limited to 'test/files/neg/t6336.scala') diff --git a/test/files/neg/t6336.scala b/test/files/neg/t6336.scala new file mode 100644 index 0000000000..a9844ff94f --- /dev/null +++ b/test/files/neg/t6336.scala @@ -0,0 +1,11 @@ +object D { + def main(args: Array[String]) { + val a = new { def y[T](x: X[T]) = x.i } + val x = new X(3) + val t = a.y(x) + println(t) + } +} + +class X[T](val i: Int) extends AnyVal + -- cgit v1.2.3