diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/classof.check | 23 | ||||
-rwxr-xr-x | test/files/run/classof.scala | 26 |
2 files changed, 47 insertions, 2 deletions
diff --git a/test/files/run/classof.check b/test/files/run/classof.check index e9a8fd6b76..af7082f5b8 100644 --- a/test/files/run/classof.check +++ b/test/files/run/classof.check @@ -1 +1,22 @@ -SomeClass +Value types: +void +boolean +byte +short +char +int +long +float +double +Class types +class SomeClass +class scala.List +class scala.Tuple2 +Arrays: +class [Lscala.runtime.BoxedUnit; +class [I +class [D +class [Lscala.List; +Functions: +interface scala.Function2 +interface scala.Function1 diff --git a/test/files/run/classof.scala b/test/files/run/classof.scala index 5c920d797f..b50facc1e9 100755 --- a/test/files/run/classof.scala +++ b/test/files/run/classof.scala @@ -3,6 +3,30 @@ class SomeClass object Test { def main(args: Array[String]): Unit = { val cls: Predef.Class[SomeClass] = classOf[SomeClass] - Console.println(cls.getName()) + println("Value types:") + println(classOf[Unit]) + println(classOf[Boolean]) + println(classOf[Byte]) + println(classOf[Short]) + println(classOf[Char]) + println(classOf[Int]) + println(classOf[Long]) + println(classOf[Float]) + println(classOf[Double]) + + println("Class types") + println(classOf[SomeClass]) + println(classOf[List[Array[Float]]]) + println(classOf[(String, Map[Int, String])]) + + println("Arrays:") + println(classOf[Array[Unit]]) + println(classOf[Array[Int]]) + println(classOf[Array[Double]]) + println(classOf[Array[List[String]]]) + + println("Functions: ") + println(classOf[(Int, Int) => Unit]) + println(classOf[Int => Boolean]) } } |