aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/neg/t7007.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/untried/neg/t7007.scala')
-rw-r--r--tests/untried/neg/t7007.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/untried/neg/t7007.scala b/tests/untried/neg/t7007.scala
new file mode 100644
index 000000000..e41dccf55
--- /dev/null
+++ b/tests/untried/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))
+
+}