summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/annot-nonconst.check2
-rw-r--r--test/files/neg/bug3736.check5
-rw-r--r--test/files/neg/super-cast-or-test.check7
-rw-r--r--test/files/neg/super-cast-or-test.scala3
-rw-r--r--test/files/neg/t3399.check2
-rw-r--r--test/files/neg/t3507.check2
-rw-r--r--test/files/neg/t4431.check7
-rw-r--r--test/files/neg/t4431.scala16
8 files changed, 40 insertions, 4 deletions
diff --git a/test/files/neg/annot-nonconst.check b/test/files/neg/annot-nonconst.check
index 385f066baa..e4166e08b6 100644
--- a/test/files/neg/annot-nonconst.check
+++ b/test/files/neg/annot-nonconst.check
@@ -11,7 +11,7 @@ class Ann2(value: String) extends ClassfileAnnotation
annot-nonconst.scala:6: error: annotation argument needs to be a constant; found: n
@Length(n) def foo = "foo"
^
-annot-nonconst.scala:7: error: annotation argument needs to be a constant; found: null
+annot-nonconst.scala:7: error: annotation argument cannot be null
@Ann2(null) def bar = "bar"
^
two warnings found
diff --git a/test/files/neg/bug3736.check b/test/files/neg/bug3736.check
index 8a91088914..cc222d1221 100644
--- a/test/files/neg/bug3736.check
+++ b/test/files/neg/bug3736.check
@@ -1,6 +1,9 @@
bug3736.scala:4: error: super not allowed here: use this.isInstanceOf instead
def f2 = super.isInstanceOf[String]
^
+bug3736.scala:5: error: super not allowed here: use this.asInstanceOf instead
+ def f3 = super.asInstanceOf[AnyRef]
+ ^
bug3736.scala:6: error: super not allowed here: use this.== instead
def f4 = super.==(new AnyRef)
^
@@ -10,4 +13,4 @@ bug3736.scala:7: error: super not allowed here: use this.!= instead
bug3736.scala:8: error: super not allowed here: use this.## instead
def f6 = super.##
^
-four errors found
+5 errors found
diff --git a/test/files/neg/super-cast-or-test.check b/test/files/neg/super-cast-or-test.check
new file mode 100644
index 0000000000..8e5eed62bd
--- /dev/null
+++ b/test/files/neg/super-cast-or-test.check
@@ -0,0 +1,7 @@
+super-cast-or-test.scala:1: error: super not allowed here: use this.asInstanceOf instead
+trait A { def f = super.asInstanceOf[AnyRef] }
+ ^
+super-cast-or-test.scala:2: error: super not allowed here: use this.isInstanceOf instead
+trait B { def g = super.isInstanceOf[AnyRef] }
+ ^
+two errors found
diff --git a/test/files/neg/super-cast-or-test.scala b/test/files/neg/super-cast-or-test.scala
new file mode 100644
index 0000000000..a0f86d8081
--- /dev/null
+++ b/test/files/neg/super-cast-or-test.scala
@@ -0,0 +1,3 @@
+trait A { def f = super.asInstanceOf[AnyRef] }
+trait B { def g = super.isInstanceOf[AnyRef] }
+
diff --git a/test/files/neg/t3399.check b/test/files/neg/t3399.check
index eb6c679704..987da944c6 100644
--- a/test/files/neg/t3399.check
+++ b/test/files/neg/t3399.check
@@ -1,4 +1,4 @@
-t3399.scala:23: error: could not find implicit value for parameter e: =:=[Nats.Add[Nats._1,Nats._1],Nats._1]
+t3399.scala:23: error: Cannot prove that Nats.Add[Nats._1,Nats._1] =:= Nats._1.
implicitly[ Add[_1, _1] =:= _1]
^
one error found
diff --git a/test/files/neg/t3507.check b/test/files/neg/t3507.check
index 1246a20d09..ab38280c1f 100644
--- a/test/files/neg/t3507.check
+++ b/test/files/neg/t3507.check
@@ -1,4 +1,4 @@
-t3507.scala:13: error: could not find implicit value for evidence parameter of type Manifest[object _1.b.c]
+t3507.scala:13: error: No Manifest available for object _1.b.c.
mani/*[object _1.b.c]*/(c) // kaboom in manifestOfType / TreeGen.mkAttributedQualifier
^
one error found
diff --git a/test/files/neg/t4431.check b/test/files/neg/t4431.check
new file mode 100644
index 0000000000..7896ec1a62
--- /dev/null
+++ b/test/files/neg/t4431.check
@@ -0,0 +1,7 @@
+t4431.scala:5: error: class BB needs to be abstract, since there is a deferred declaration of method f which is not implemented in a subclass
+ class BB extends B { def f (): Unit }
+ ^
+t4431.scala:8: error: trait cannot redefine final method from class AnyRef
+ trait C { def wait (): Unit }
+ ^
+two errors found
diff --git a/test/files/neg/t4431.scala b/test/files/neg/t4431.scala
new file mode 100644
index 0000000000..5fbb239e04
--- /dev/null
+++ b/test/files/neg/t4431.scala
@@ -0,0 +1,16 @@
+object Test {
+ // this works.
+ class B { final def f(): Unit = () }
+ trait A extends B { def f (): Unit }
+ class BB extends B { def f (): Unit }
+
+ // this earns a VerifyError.
+ trait C { def wait (): Unit }
+ class D { }
+
+ def main(args: Array[String]): Unit = {
+ new B with A { }
+ new BB
+// new D with C { }
+ }
+}