diff options
author | Paul Phillips <paulp@improving.org> | 2011-06-23 06:13:31 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-06-23 06:13:31 +0000 |
commit | 8ba9b511c2b11d0514013bb1e18cbc8a7b9e5f5c (patch) | |
tree | 0aaa38ebc8e9d7a7c6066db60b0dd9f1e13f390d /test/files | |
parent | 21115422de226f874c73bbfed1a31904432c6e8d (diff) | |
download | scala-8ba9b511c2b11d0514013bb1e18cbc8a7b9e5f5c.tar.gz scala-8ba9b511c2b11d0514013bb1e18cbc8a7b9e5f5c.tar.bz2 scala-8ba9b511c2b11d0514013bb1e18cbc8a7b9e5f5c.zip |
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.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/bug4731.scala | 14 |
1 files changed, 14 insertions, 0 deletions
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]) + } +} |