From 5d9cde105e804d14e2c15c3e15c147a56cb67ff1 Mon Sep 17 00:00:00 2001 From: Grzegorz Kossakowski Date: Wed, 3 Oct 2012 14:43:30 +0200 Subject: Put more implementation restrictions on value classes. Nested objects, classes and lazy vals are disallowed at any nesting level in value classes; e.g. lazy vals local to a method defined in a value class. There are still allowed in universal traits. This is a temporary, implementation restriction that is planned to be addressed in future releases of Scala. Error messages has been updated to communicate that intent. Moved tests for SI-5582 and SI-6408 to pending folder. They have to stay there until implementation restrictions are addressed. Closes SI-6408 and SI-6432. Review by @odersky, @harrah and @adriaanm. --- test/pending/run/t6408.scala | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/pending/run/t6408.scala (limited to 'test/pending/run/t6408.scala') diff --git a/test/pending/run/t6408.scala b/test/pending/run/t6408.scala new file mode 100644 index 0000000000..ff17480b35 --- /dev/null +++ b/test/pending/run/t6408.scala @@ -0,0 +1,11 @@ +class X(val i: Int) extends AnyVal { + class Inner(val q: Int) { + def plus = i + q + } +} + +object Test extends App { + val x = new X(11) + val i = new x.Inner(22) + assert(i.plus == 33) +} -- cgit v1.2.3