summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t6500.scala13
-rw-r--r--test/files/run/t6534.scala14
2 files changed, 27 insertions, 0 deletions
diff --git a/test/files/run/t6500.scala b/test/files/run/t6500.scala
new file mode 100644
index 0000000000..03a68a3a24
--- /dev/null
+++ b/test/files/run/t6500.scala
@@ -0,0 +1,13 @@
+object Test extends App {
+ class Box(val value: Int) extends AnyVal
+
+ trait Foo {
+ def append(box: Box): Foo
+ }
+
+ class Bar extends Foo {
+ override def append(box: Box): Bar = this // produces bad forwarder
+ }
+
+ ((new Bar): Foo).append(new Box(0))
+}
diff --git a/test/files/run/t6534.scala b/test/files/run/t6534.scala
new file mode 100644
index 0000000000..33df97e41e
--- /dev/null
+++ b/test/files/run/t6534.scala
@@ -0,0 +1,14 @@
+trait Foo extends Any { override def equals(x: Any) = false }
+trait Ding extends Any { override def hashCode = -1 }
+
+class Bippy1(val x: Int) extends AnyVal with Foo { } // warn
+class Bippy2(val x: Int) extends AnyVal with Ding { } // warn
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val b1 = new Bippy1(71)
+ val b2 = new Bippy2(71)
+ assert(b1 == b1 && b1.## == b1.x.##, ((b1, b1.##)))
+ assert(b2 == b2 && b2.## == b2.x.##, ((b2, b2.##)))
+ }
+}