diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2012-10-03 14:43:30 +0200 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2012-10-03 14:43:30 +0200 |
commit | 5d9cde105e804d14e2c15c3e15c147a56cb67ff1 (patch) | |
tree | 7d1ea64620c7e782a302ee7108a21fc6e4388853 /test/files/neg/valueclasses-impl-restrictions.check | |
parent | ea9e4ec55ebb5dd6aaf22862622add7608e3f7a0 (diff) | |
download | scala-5d9cde105e804d14e2c15c3e15c147a56cb67ff1.tar.gz scala-5d9cde105e804d14e2c15c3e15c147a56cb67ff1.tar.bz2 scala-5d9cde105e804d14e2c15c3e15c147a56cb67ff1.zip |
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.
Diffstat (limited to 'test/files/neg/valueclasses-impl-restrictions.check')
-rw-r--r-- | test/files/neg/valueclasses-impl-restrictions.check | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/files/neg/valueclasses-impl-restrictions.check b/test/files/neg/valueclasses-impl-restrictions.check new file mode 100644 index 0000000000..17d07ba960 --- /dev/null +++ b/test/files/neg/valueclasses-impl-restrictions.check @@ -0,0 +1,21 @@ +valueclasses-impl-restrictions.scala:3: error: implementation restriction: nested object is not allowed in value class +This restriction is planned to be removed in subsequent releases. + object X + ^ +valueclasses-impl-restrictions.scala:4: error: implementation restriction: lazy val is not allowed in value class +This restriction is planned to be removed in subsequent releases. + lazy val y = 1 + ^ +valueclasses-impl-restrictions.scala:10: error: implementation restriction: nested trait is not allowed in value class +This restriction is planned to be removed in subsequent releases. + trait I2 { + ^ +valueclasses-impl-restrictions.scala:16: error: implementation restriction: nested class is not allowed in value class +This restriction is planned to be removed in subsequent releases. + val i2 = new I2 { val q = x.s } + ^ +valueclasses-impl-restrictions.scala:22: error: implementation restriction: nested class is not allowed in value class +This restriction is planned to be removed in subsequent releases. + private[this] class I2(val q: String) + ^ +5 errors found |