diff options
Diffstat (limited to 'test/files/jvm/manifests.scala')
-rw-r--r-- | test/files/jvm/manifests.scala | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/test/files/jvm/manifests.scala b/test/files/jvm/manifests.scala index 6bbea4d052..935427f5d4 100644 --- a/test/files/jvm/manifests.scala +++ b/test/files/jvm/manifests.scala @@ -1,7 +1,6 @@ object Test extends App { Test1 Test2 - //Test3 // Java 1.5+ only } class Foo[T](x: T) @@ -51,7 +50,8 @@ object Test1 extends TestUtil { print(new Foo(List(new Foo(2)))) println() - print(new Bar[String] { def f = "abc" }) + print(new Bar[String] { def f = "abc" }); + {print(new Bar[String] { def f = "abc" })} println() } @@ -88,15 +88,6 @@ object Test2 { println() } -object Test3 extends TestUtil { - import scala.reflect.Manifest._ - val ct1 = classType(classOf[Char]) - val ct2 = classType(classOf[List[_]], ct1) - print(ct1) - //print(ct2) // ??? x=scala.List[char], m=scala.reflect.Manifest[scala.runtime.Nothing$] - println() -} - trait TestUtil { import java.io._ def write[A](o: A): Array[Byte] = { @@ -112,8 +103,10 @@ trait TestUtil { } import scala.reflect._ def print[T](x: T)(implicit m: Manifest[T]) { - val m1: Manifest[T] = read(write(m)) + // manifests are no longer serializable +// val m1: Manifest[T] = read(write(m)) + val m1: Manifest[T] = m val x1 = x.toString.replaceAll("@[0-9a-z]+$", "") - println("x="+x1+", m="+m1) + println("x="+x1+", m="+m1+", k="+m1.tpe.kind+", s="+m1.sym.toString) } } |