summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t5882.check6
-rw-r--r--test/files/neg/t6359.check6
-rw-r--r--test/files/neg/valueclasses-impl-restrictions.check21
-rw-r--r--test/files/neg/valueclasses-impl-restrictions.scala28
-rw-r--r--test/pending/run/t5882.scala (renamed from test/files/run/t5882.scala)0
-rw-r--r--test/pending/run/t6408.scala (renamed from test/files/run/t6408.scala)0
6 files changed, 57 insertions, 4 deletions
diff --git a/test/files/neg/t5882.check b/test/files/neg/t5882.check
index b9ca5a1b2a..e0958e19d9 100644
--- a/test/files/neg/t5882.check
+++ b/test/files/neg/t5882.check
@@ -1,7 +1,9 @@
-t5882.scala:4: error: nested object is not allowed in value class
+t5882.scala:4: error: implementation restriction: nested class is not allowed in value class
+This restriction is planned to be removed in subsequent releases.
case class Scope()
^
-t5882.scala:5: error: nested object is not allowed in value class
+t5882.scala:5: error: implementation restriction: nested object is not allowed in value class
+This restriction is planned to be removed in subsequent releases.
object Bar
^
two errors found
diff --git a/test/files/neg/t6359.check b/test/files/neg/t6359.check
index 2aa1ac5035..5bcdc57331 100644
--- a/test/files/neg/t6359.check
+++ b/test/files/neg/t6359.check
@@ -1,7 +1,9 @@
-t6359.scala:3: error: value class may not have nested module definitions
+t6359.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
^
-t6359.scala:4: error: value class may not have nested class definitions
+t6359.scala:4: error: implementation restriction: nested class is not allowed in value class
+This restriction is planned to be removed in subsequent releases.
class Y
^
two errors found
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
diff --git a/test/files/neg/valueclasses-impl-restrictions.scala b/test/files/neg/valueclasses-impl-restrictions.scala
new file mode 100644
index 0000000000..53396db958
--- /dev/null
+++ b/test/files/neg/valueclasses-impl-restrictions.scala
@@ -0,0 +1,28 @@
+class M(val t: Int) extends AnyVal {
+ def lazyString = {
+ object X
+ lazy val y = 1
+ () => X
+ }
+}
+
+class X1(val s: String) extends AnyVal {
+ trait I2 {
+ val q: String
+ def z = s + q
+ }
+
+ def y(x: X1) = {
+ val i2 = new I2 { val q = x.s }
+ i2.z
+ }
+}
+
+class X2(val s: String) extends AnyVal {
+ private[this] class I2(val q: String)
+
+ def y(i: Int) = {
+ val i2 = new I2(i.toString)
+ i2.q + s
+ }
+}
diff --git a/test/files/run/t5882.scala b/test/pending/run/t5882.scala
index 47996d3068..47996d3068 100644
--- a/test/files/run/t5882.scala
+++ b/test/pending/run/t5882.scala
diff --git a/test/files/run/t6408.scala b/test/pending/run/t6408.scala
index ff17480b35..ff17480b35 100644
--- a/test/files/run/t6408.scala
+++ b/test/pending/run/t6408.scala