diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-01-31 13:34:34 -0800 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-01-31 13:34:34 -0800 |
commit | 624e668acfead08289078662d43d281b7b445d71 (patch) | |
tree | f48dbce980bd3f7ffafa4fce683068e1c484ba46 /test/files/run | |
parent | a6f2704619a1f724693b456dadcb1836e2f71328 (diff) | |
parent | d0afd7ece04e1974093c8c37b0ff6654742ab57b (diff) | |
download | scala-624e668acfead08289078662d43d281b7b445d71.tar.gz scala-624e668acfead08289078662d43d281b7b445d71.tar.bz2 scala-624e668acfead08289078662d43d281b7b445d71.zip |
Merge pull request #3425 from retronym/ticket/7700
SI-7700 @unspecialized, Part Deux: Now Working.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t7700.check | 2 | ||||
-rw-r--r-- | test/files/run/t7700.scala | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/test/files/run/t7700.check b/test/files/run/t7700.check new file mode 100644 index 0000000000..ca8e686984 --- /dev/null +++ b/test/files/run/t7700.check @@ -0,0 +1,2 @@ +public abstract java.lang.Object C.bar(java.lang.Object) +public abstract java.lang.Object C.foo(java.lang.Object) diff --git a/test/files/run/t7700.scala b/test/files/run/t7700.scala new file mode 100644 index 0000000000..76d16b808c --- /dev/null +++ b/test/files/run/t7700.scala @@ -0,0 +1,17 @@ +import scala.annotation._ + +trait C[@specialized U] { + @unspecialized + def foo(u: U): U + @unspecialized + def bar[A](u: U) = u +} + +object Test extends App { + val declared = classOf[C[_]].getDeclaredMethods.sortBy(_.getName) + println(declared.mkString("\n")) + object CInt extends C[Int] { def foo(i: Int) = i } + object CAny extends C[Any] { def foo(a: Any) = a } + assert(CInt.foo(1) == 1) + assert(CAny.foo("") == "") +} |