diff options
author | Josh Suereth <joshua.suereth@gmail.com> | 2012-11-05 12:52:56 -0500 |
---|---|---|
committer | Josh Suereth <joshua.suereth@gmail.com> | 2012-11-05 12:52:56 -0500 |
commit | aedc853040d7774bd39df43a51715f674f99471e (patch) | |
tree | 3d9fad1100c241b8663703898e46c030698eafe7 /test/files/run | |
parent | 999918311b7bf764916431485cb11043f1c220ed (diff) | |
parent | 8b598436f64ca4e980c8a38f642085b4d23e2327 (diff) | |
download | scala-aedc853040d7774bd39df43a51715f674f99471e.tar.gz scala-aedc853040d7774bd39df43a51715f674f99471e.tar.bz2 scala-aedc853040d7774bd39df43a51715f674f99471e.zip |
Merge branch '2.10.0-wip' into merge-2.10.0
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t6500.scala | 13 | ||||
-rw-r--r-- | test/files/run/t6534.scala | 14 |
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.##))) + } +} |