From 7a25e65f828a04825d1b4a20491892b5a724f812 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Sat, 4 Jul 2015 19:22:56 +0200 Subject: Tests that objects nested in value class methods work This confirms that SI-6359 does not apply to Dotty. --- tests/run/valueclasses-nested-object.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/run/valueclasses-nested-object.scala (limited to 'tests/run/valueclasses-nested-object.scala') diff --git a/tests/run/valueclasses-nested-object.scala b/tests/run/valueclasses-nested-object.scala new file mode 100644 index 000000000..3042592e4 --- /dev/null +++ b/tests/run/valueclasses-nested-object.scala @@ -0,0 +1,16 @@ +class M(val t: Int) extends AnyVal { + // Disallowed in Scala 2.11 (see SI-6359) + def o = { + object X { + override def toString = t.toString + } + () => X + } +} + +object Test { + def main(args: Array[String]): Unit = { + val x = new M(3) + println(x.o()) + } +} -- cgit v1.2.3