summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/list/test-neg.lst1
-rw-r--r--test/files/neg/overlapping.check6
-rw-r--r--test/files/neg/overlapping.scala10
-rw-r--r--test/neg/overlapping.check6
-rw-r--r--test/neg/overlapping.scala10
5 files changed, 33 insertions, 0 deletions
diff --git a/config/list/test-neg.lst b/config/list/test-neg.lst
index c8f881fbea..e99721fa68 100644
--- a/config/list/test-neg.lst
+++ b/config/list/test-neg.lst
@@ -29,6 +29,7 @@ neg/cyclic.scala
neg/imports.scala
neg/matthias2.scala
neg/michel2.scala
+neg/overlapping.scala
neg/protected.scala
neg/refine.scala
neg/seqtest.scala
diff --git a/test/files/neg/overlapping.check b/test/files/neg/overlapping.check
new file mode 100644
index 0000000000..68251d32f7
--- /dev/null
+++ b/test/files/neg/overlapping.check
@@ -0,0 +1,6 @@
+overlapping.scala:9: overlapping overloaded alternatives; the two following alternatives of method foo have the same erasure: ()Any
+ alternative 1: def foo: X.this.I
+ alternative 2: def foo: X.this.J
+ def foo: J;
+ ^
+one error found
diff --git a/test/files/neg/overlapping.scala b/test/files/neg/overlapping.scala
new file mode 100644
index 0000000000..1c4a82ef79
--- /dev/null
+++ b/test/files/neg/overlapping.scala
@@ -0,0 +1,10 @@
+// Tests detection of overlapping erased signatures
+
+// $Id$
+
+trait X {
+ type I;
+ type J;
+ def foo: I;
+ def foo: J;
+}
diff --git a/test/neg/overlapping.check b/test/neg/overlapping.check
new file mode 100644
index 0000000000..68251d32f7
--- /dev/null
+++ b/test/neg/overlapping.check
@@ -0,0 +1,6 @@
+overlapping.scala:9: overlapping overloaded alternatives; the two following alternatives of method foo have the same erasure: ()Any
+ alternative 1: def foo: X.this.I
+ alternative 2: def foo: X.this.J
+ def foo: J;
+ ^
+one error found
diff --git a/test/neg/overlapping.scala b/test/neg/overlapping.scala
new file mode 100644
index 0000000000..1c4a82ef79
--- /dev/null
+++ b/test/neg/overlapping.scala
@@ -0,0 +1,10 @@
+// Tests detection of overlapping erased signatures
+
+// $Id$
+
+trait X {
+ type I;
+ type J;
+ def foo: I;
+ def foo: J;
+}