summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/anyval-children-2.check4
-rw-r--r--test/files/neg/anyval-children-2.scala1
-rw-r--r--test/files/neg/anyval-children.check26
-rw-r--r--test/files/neg/anyval-children.scala14
-rw-r--r--test/files/neg/anyval-sealed.check12
-rw-r--r--test/files/neg/anyval-sealed.flags1
-rw-r--r--test/files/neg/anyval-sealed.scala6
-rw-r--r--test/files/neg/override-object-no.check12
-rw-r--r--test/files/neg/t0699.check6
-rw-r--r--test/files/neg/t3222.check6
10 files changed, 57 insertions, 31 deletions
diff --git a/test/files/neg/anyval-children-2.check b/test/files/neg/anyval-children-2.check
new file mode 100644
index 0000000000..cb327faeeb
--- /dev/null
+++ b/test/files/neg/anyval-children-2.check
@@ -0,0 +1,4 @@
+anyval-children-2.scala:1: error: Only @inline classes (not traits) are allowed to extend AnyVal
+@inline trait NotOkDingus1 extends AnyVal // fail
+ ^
+one error found
diff --git a/test/files/neg/anyval-children-2.scala b/test/files/neg/anyval-children-2.scala
new file mode 100644
index 0000000000..4034eb22dd
--- /dev/null
+++ b/test/files/neg/anyval-children-2.scala
@@ -0,0 +1 @@
+@inline trait NotOkDingus1 extends AnyVal // fail
diff --git a/test/files/neg/anyval-children.check b/test/files/neg/anyval-children.check
new file mode 100644
index 0000000000..cbb5a2b1d1
--- /dev/null
+++ b/test/files/neg/anyval-children.check
@@ -0,0 +1,26 @@
+anyval-children.scala:7: error: illegal inheritance; superclass Bippy
+ is not a subclass of the superclass Object
+ of the mixin trait ScalaObject
+class NotOkBippy1 extends Bippy // fail
+ ^
+anyval-children.scala:9: error: illegal inheritance; superclass Bippy
+ is not a subclass of the superclass Object
+ of the mixin trait Immutable
+class NotOkBippy2 extends Bippy with Immutable //fail
+ ^
+anyval-children.scala:9: error: illegal inheritance; superclass Bippy
+ is not a subclass of the superclass Object
+ of the mixin trait ScalaObject
+class NotOkBippy2 extends Bippy with Immutable //fail
+ ^
+anyval-children.scala:11: error: illegal inheritance; superclass Bippy
+ is not a subclass of the superclass Object
+ of the mixin trait Immutable
+@inline class NotOkBippy3 extends Bippy with Immutable //fail
+ ^
+anyval-children.scala:11: error: illegal inheritance; superclass Bippy
+ is not a subclass of the superclass Object
+ of the mixin trait ScalaObject
+@inline class NotOkBippy3 extends Bippy with Immutable //fail
+ ^
+5 errors found
diff --git a/test/files/neg/anyval-children.scala b/test/files/neg/anyval-children.scala
new file mode 100644
index 0000000000..5a6109f786
--- /dev/null
+++ b/test/files/neg/anyval-children.scala
@@ -0,0 +1,14 @@
+class Bippy extends AnyVal // fail
+
+@inline class NotOkDingus2 extends Immutable with AnyVal // fail
+
+@inline object NotOkDingus3 extends AnyVal // fail
+
+class NotOkBippy1 extends Bippy // fail
+
+class NotOkBippy2 extends Bippy with Immutable //fail
+
+@inline class NotOkBippy3 extends Bippy with Immutable //fail
+
+
+@inline class OkBippy extends AnyVal // ok
diff --git a/test/files/neg/anyval-sealed.check b/test/files/neg/anyval-sealed.check
deleted file mode 100644
index 48a457b496..0000000000
--- a/test/files/neg/anyval-sealed.check
+++ /dev/null
@@ -1,12 +0,0 @@
-anyval-sealed.scala:2: error: match is not exhaustive!
-missing combination Byte
-missing combination Char
-missing combination Double
-missing combination Float
-missing combination Long
-missing combination Short
-missing combination Unit
-
- def f(x: AnyVal) = x match {
- ^
-one error found
diff --git a/test/files/neg/anyval-sealed.flags b/test/files/neg/anyval-sealed.flags
deleted file mode 100644
index 85d8eb2ba2..0000000000
--- a/test/files/neg/anyval-sealed.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xfatal-warnings
diff --git a/test/files/neg/anyval-sealed.scala b/test/files/neg/anyval-sealed.scala
deleted file mode 100644
index 232a183479..0000000000
--- a/test/files/neg/anyval-sealed.scala
+++ /dev/null
@@ -1,6 +0,0 @@
-class A {
- def f(x: AnyVal) = x match {
- case _: Boolean => 1
- case _: Int => 2
- }
-} \ No newline at end of file
diff --git a/test/files/neg/override-object-no.check b/test/files/neg/override-object-no.check
index 6e028d0add..f9fb37381b 100644
--- a/test/files/neg/override-object-no.check
+++ b/test/files/neg/override-object-no.check
@@ -1,13 +1,13 @@
override-object-no.scala:14: error: overriding object Bar in trait Foo with object Bar in trait Foo2:
an overriding object must conform to the overridden object's class bound;
- found : case1.Bippy with ScalaObject
- required: case1.Bippy with case1.Bippo with ScalaObject
+ found : case1.Bippy
+ required: case1.Bippy with case1.Bippo
override object Bar extends Bippy { // err
^
override-object-no.scala:21: error: overriding object Bar in trait Quux1 with object Bar in trait Quux2:
an overriding object must conform to the overridden object's class bound;
- found : Object with ScalaObject{def g: String}
- required: Object with ScalaObject{def g: Int}
+ found : Object{def g: String}
+ required: Object{def g: Int}
trait Quux2 extends Quux1 { override object Bar { def g = "abc" } } // err
^
override-object-no.scala:25: error: overriding object Bar in trait Quux3 of type object Quux4.this.Bar;
@@ -16,8 +16,8 @@ override-object-no.scala:25: error: overriding object Bar in trait Quux3 of type
^
override-object-no.scala:43: error: overriding object A in class Foo with object A in class P2:
an overriding object must conform to the overridden object's class bound;
- found : case2.Bar[List[String]] with ScalaObject
- required: case2.Bar[Traversable[String]] with ScalaObject
+ found : case2.Bar[List[String]]
+ required: case2.Bar[Traversable[String]]
override object A extends Bar[List[String]] // err
^
four errors found
diff --git a/test/files/neg/t0699.check b/test/files/neg/t0699.check
index 45d3e849cc..c944da8c10 100644
--- a/test/files/neg/t0699.check
+++ b/test/files/neg/t0699.check
@@ -1,10 +1,10 @@
-B.scala:2: error: illegal inheritance from sealed trait T: t0699/B.scala != t0699/A.scala
+B.scala:2: error: illegal inheritance from sealed trait T
trait T1 extends A.T
^
-B.scala:3: error: illegal inheritance from sealed class C: t0699/B.scala != t0699/A.scala
+B.scala:3: error: illegal inheritance from sealed class C
trait T2 extends A.C
^
-B.scala:4: error: illegal inheritance from sealed class C: t0699/B.scala != t0699/A.scala
+B.scala:4: error: illegal inheritance from sealed class C
class C1 extends A.C
^
three errors found
diff --git a/test/files/neg/t3222.check b/test/files/neg/t3222.check
index e724024f45..b1e1e50448 100644
--- a/test/files/neg/t3222.check
+++ b/test/files/neg/t3222.check
@@ -1,7 +1,7 @@
-t3222.scala:4: error: not found: type D
- def foo(@throws(classOf[D]) x: Int) {}
- ^
t3222.scala:1: error: not found: type B
@throws(classOf[B])
^
+t3222.scala:4: error: not found: type D
+ def foo(@throws(classOf[D]) x: Int) {}
+ ^
two errors found