diff options
author | David MacIver <david.maciver@gmail.com> | 2008-10-30 22:39:33 +0000 |
---|---|---|
committer | David MacIver <david.maciver@gmail.com> | 2008-10-30 22:39:33 +0000 |
commit | 99529c51c054b3873442c5cbef34b81b84798434 (patch) | |
tree | e4fcea6afc6de516bf45b40276f6390f6ae90327 | |
parent | 683e15f02b6e9980a9017e9193651c746685a2eb (diff) | |
download | scala-99529c51c054b3873442c5cbef34b81b84798434.tar.gz scala-99529c51c054b3873442c5cbef34b81b84798434.tar.bz2 scala-99529c51c054b3873442c5cbef34b81b84798434.zip |
Test cases for some of Martin's fixes.
-rw-r--r-- | test/files/jvm5/t1461.scala | 18 | ||||
-rw-r--r-- | test/files/jvm5/t1464.check | 1 | ||||
-rw-r--r-- | test/files/jvm5/t1464/MyTrait.scala | 5 | ||||
-rw-r--r-- | test/files/jvm5/t1464/Test.java | 6 |
4 files changed, 30 insertions, 0 deletions
diff --git a/test/files/jvm5/t1461.scala b/test/files/jvm5/t1461.scala new file mode 100644 index 0000000000..f0e3cea6cd --- /dev/null +++ b/test/files/jvm5/t1461.scala @@ -0,0 +1,18 @@ + +object Test { + def main(args: Array[String]) { + val jl = classOf[Foo].getMethod("jl", classOf[Baz[_]]) + jl.getGenericParameterTypes // works fine + + val l = classOf[Foo].getMethod("l", classOf[Baz[_]]) + // By debugger inspection l.signature is (Ltest/Baz<J>;)V + l.getGenericParameterTypes // throws GenericSignatureFormatError + } +} + +class Baz[T] + +class Foo { + def l(b: Baz[Long]) { } + def jl(b: Baz[java.lang.Long]) { } +} diff --git a/test/files/jvm5/t1464.check b/test/files/jvm5/t1464.check new file mode 100644 index 0000000000..c508d5366f --- /dev/null +++ b/test/files/jvm5/t1464.check @@ -0,0 +1 @@ +false diff --git a/test/files/jvm5/t1464/MyTrait.scala b/test/files/jvm5/t1464/MyTrait.scala new file mode 100644 index 0000000000..0b8ccc412b --- /dev/null +++ b/test/files/jvm5/t1464/MyTrait.scala @@ -0,0 +1,5 @@ +trait MyTrait { + type K + def findChildByClass[T <: K with MyTrait]: Unit + +} diff --git a/test/files/jvm5/t1464/Test.java b/test/files/jvm5/t1464/Test.java new file mode 100644 index 0000000000..235848b1df --- /dev/null +++ b/test/files/jvm5/t1464/Test.java @@ -0,0 +1,6 @@ +public class Test { + public static void main(String[] args) { + Object o = new Object(); + System.out.println(o instanceof MyTrait); + } +} |