summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/t1909-object.check4
-rw-r--r--test/files/neg/t1909-object.flags1
-rw-r--r--test/files/neg/t1909-object.scala12
-rw-r--r--test/files/neg/t284.check8
-rw-r--r--test/files/neg/t284.flags1
-rw-r--r--test/files/neg/t284.scala7
-rw-r--r--test/files/neg/t7007.check7
-rw-r--r--test/files/neg/t7007.scala14
8 files changed, 45 insertions, 9 deletions
diff --git a/test/files/neg/t1909-object.check b/test/files/neg/t1909-object.check
new file mode 100644
index 0000000000..401c1f7ebf
--- /dev/null
+++ b/test/files/neg/t1909-object.check
@@ -0,0 +1,4 @@
+t1909-object.scala:4: error: !!! SI-1909 Unable to STATICally lift object InnerTrouble$1, which is defined in the self- or super-constructor call of class Kaboom. A VerifyError is likely.
+ object InnerTrouble
+ ^
+one error found
diff --git a/test/files/neg/t1909-object.flags b/test/files/neg/t1909-object.flags
new file mode 100644
index 0000000000..eb8b40661b
--- /dev/null
+++ b/test/files/neg/t1909-object.flags
@@ -0,0 +1 @@
+-Xdev -Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/t1909-object.scala b/test/files/neg/t1909-object.scala
new file mode 100644
index 0000000000..d6011ba4a5
--- /dev/null
+++ b/test/files/neg/t1909-object.scala
@@ -0,0 +1,12 @@
+class Kaboom(a: Any) {
+ def this() = {
+ this({
+ object InnerTrouble
+ InnerTrouble
+ })
+ }
+}
+
+object Test extends App {
+ new Kaboom()
+} \ No newline at end of file
diff --git a/test/files/neg/t284.check b/test/files/neg/t284.check
index 37801af1b5..7c2e9be03e 100644
--- a/test/files/neg/t284.check
+++ b/test/files/neg/t284.check
@@ -1,8 +1,6 @@
t284.scala:2: warning: Detected apparent refinement of Unit; are you missing an '=' sign?
- def f1(a: T): Unit { }
- ^
-t284.scala:5: error: Unmatched closing brace '}' ignored here
- }
- ^
+ def f1(a: T): Unit { }
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
one warning found
one error found
diff --git a/test/files/neg/t284.flags b/test/files/neg/t284.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/neg/t284.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/t284.scala b/test/files/neg/t284.scala
index a210130102..f75bc3d4ba 100644
--- a/test/files/neg/t284.scala
+++ b/test/files/neg/t284.scala
@@ -1,6 +1,5 @@
trait B[T] {
- def f1(a: T): Unit { }
- def f2(a: T): Unit
- def f3(a: T) { }
- }
+ def f1(a: T): Unit { }
+ def f2(a: T): Unit
+ def f3(a: T) { }
}
diff --git a/test/files/neg/t7007.check b/test/files/neg/t7007.check
new file mode 100644
index 0000000000..e22ecb9e4e
--- /dev/null
+++ b/test/files/neg/t7007.check
@@ -0,0 +1,7 @@
+t7007.scala:5: error: Implementation restriction: <$anon: A => B> requires premature access to class Crash.
+ def this(a: Seq[A]) = this(a.collect{ case b: B => b}, a.collect{ case b: B => b})
+ ^
+t7007.scala:5: error: Implementation restriction: <$anon: A => B> requires premature access to class Crash.
+ def this(a: Seq[A]) = this(a.collect{ case b: B => b}, a.collect{ case b: B => b})
+ ^
+two errors found
diff --git a/test/files/neg/t7007.scala b/test/files/neg/t7007.scala
new file mode 100644
index 0000000000..e41dccf550
--- /dev/null
+++ b/test/files/neg/t7007.scala
@@ -0,0 +1,14 @@
+class A
+class B extends A
+
+class Crash(b1: Seq[B], b2: Seq[B]) {
+ def this(a: Seq[A]) = this(a.collect{ case b: B => b}, a.collect{ case b: B => b})
+}
+
+object Main extends App {
+
+ // runtime exception with either constructor
+ val c1 = new Crash(Seq(new B, new B))
+ val c2 = new Crash(Seq(new B), Seq(new B))
+
+}