From 8ba9b511c2b11d0514013bb1e18cbc8a7b9e5f5c Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 23 Jun 2011 06:13:31 +0000 Subject: Notice when erasure is trying to cast something... Notice when erasure is trying to cast something to Unit, and don't do it. I'm not sure at what prior point such things should have been caught, but for now we can have a sanity check. Closes #4731, review by odersky. --- test/files/pos/bug4731.scala | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/files/pos/bug4731.scala (limited to 'test') diff --git a/test/files/pos/bug4731.scala b/test/files/pos/bug4731.scala new file mode 100644 index 0000000000..d457543c1f --- /dev/null +++ b/test/files/pos/bug4731.scala @@ -0,0 +1,14 @@ +import java.util.Comparator + +trait Trait1[T] { def foo(arg: Comparator[T]): Unit } + +trait Trait2[T] extends Trait1[T] { def foo(arg: Comparator[String]): Int = 0 } + +class Class1 extends Trait2[String] { } + +object Test { + def main(args: Array[String]): Unit = { + val c = new Class1 + c.foo(Ordering[String]) + } +} -- cgit v1.2.3