From d4b8d8deefcdd9144ef39d1456b03aa693f93ff7 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Sun, 22 Apr 2012 22:02:34 +0200 Subject: interop between manifests and tags --- ...op_classmanifests_arenot_concretetypetags.check | 4 ++++ ...op_classmanifests_arenot_concretetypetags.scala | 9 ++++++++ .../neg/interop_classtags_arenot_manifests.check | 7 +++++++ .../neg/interop_classtags_arenot_manifests.scala | 17 +++++++++++++++ ...interop_erasuretags_arenot_classmanifests.check | 4 ++++ ...interop_erasuretags_arenot_classmanifests.scala | 9 ++++++++ .../neg/interop_erasuretags_arenot_manifests.check | 4 ++++ .../neg/interop_erasuretags_arenot_manifests.scala | 9 ++++++++ .../interop_typetags_arenot_classmanifests.check | 4 ++++ .../interop_typetags_arenot_classmanifests.scala | 9 ++++++++ .../neg/interop_typetags_arenot_manifests.check | 4 ++++ .../neg/interop_typetags_arenot_manifests.scala | 9 ++++++++ ...erop_classmanifests_arepartially_typetags.check | 6 ++++++ ...erop_classmanifests_arepartially_typetags.scala | 10 +++++++++ .../run/interop_classtags_are_classmanifests.check | 6 ++++++ .../run/interop_classtags_are_classmanifests.scala | 17 +++++++++++++++ ...terop_concretetypetags_are_classmanifests.check | 3 +++ ...terop_concretetypetags_are_classmanifests.scala | 9 ++++++++ .../interop_concretetypetags_are_manifests.check | 3 +++ .../interop_concretetypetags_are_manifests.scala | 9 ++++++++ .../run/interop_manifests_are_classtags.check | 24 ++++++++++++++++++++++ .../run/interop_manifests_are_classtags.scala | 23 +++++++++++++++++++++ .../interop_manifests_are_concretetypetags.check | 6 ++++++ .../interop_manifests_are_concretetypetags.scala | 10 +++++++++ .../files/run/interop_manifests_are_typetags.check | 6 ++++++ .../files/run/interop_manifests_are_typetags.scala | 10 +++++++++ 26 files changed, 231 insertions(+) create mode 100644 test/files/neg/interop_classmanifests_arenot_concretetypetags.check create mode 100644 test/files/neg/interop_classmanifests_arenot_concretetypetags.scala create mode 100644 test/files/neg/interop_classtags_arenot_manifests.check create mode 100644 test/files/neg/interop_classtags_arenot_manifests.scala create mode 100644 test/files/neg/interop_erasuretags_arenot_classmanifests.check create mode 100644 test/files/neg/interop_erasuretags_arenot_classmanifests.scala create mode 100644 test/files/neg/interop_erasuretags_arenot_manifests.check create mode 100644 test/files/neg/interop_erasuretags_arenot_manifests.scala create mode 100644 test/files/neg/interop_typetags_arenot_classmanifests.check create mode 100644 test/files/neg/interop_typetags_arenot_classmanifests.scala create mode 100644 test/files/neg/interop_typetags_arenot_manifests.check create mode 100644 test/files/neg/interop_typetags_arenot_manifests.scala create mode 100644 test/files/run/interop_classmanifests_arepartially_typetags.check create mode 100644 test/files/run/interop_classmanifests_arepartially_typetags.scala create mode 100644 test/files/run/interop_classtags_are_classmanifests.check create mode 100644 test/files/run/interop_classtags_are_classmanifests.scala create mode 100644 test/files/run/interop_concretetypetags_are_classmanifests.check create mode 100644 test/files/run/interop_concretetypetags_are_classmanifests.scala create mode 100644 test/files/run/interop_concretetypetags_are_manifests.check create mode 100644 test/files/run/interop_concretetypetags_are_manifests.scala create mode 100644 test/files/run/interop_manifests_are_classtags.check create mode 100644 test/files/run/interop_manifests_are_classtags.scala create mode 100644 test/files/run/interop_manifests_are_concretetypetags.check create mode 100644 test/files/run/interop_manifests_are_concretetypetags.scala create mode 100644 test/files/run/interop_manifests_are_typetags.check create mode 100644 test/files/run/interop_manifests_are_typetags.scala (limited to 'test') diff --git a/test/files/neg/interop_classmanifests_arenot_concretetypetags.check b/test/files/neg/interop_classmanifests_arenot_concretetypetags.check new file mode 100644 index 0000000000..d6fa564df4 --- /dev/null +++ b/test/files/neg/interop_classmanifests_arenot_concretetypetags.check @@ -0,0 +1,4 @@ +interop_classmanifests_arenot_concretetypetags.scala:3: error: No ConcreteTypeTag available for T + println(concreteTypeTag[T]) + ^ +one error found diff --git a/test/files/neg/interop_classmanifests_arenot_concretetypetags.scala b/test/files/neg/interop_classmanifests_arenot_concretetypetags.scala new file mode 100644 index 0000000000..5b1ed55e47 --- /dev/null +++ b/test/files/neg/interop_classmanifests_arenot_concretetypetags.scala @@ -0,0 +1,9 @@ +object Test extends App { + def classManifestIsnotConcreteTypeTag[T: ClassManifest] = { + println(concreteTypeTag[T]) + } + + classManifestIsnotConcreteTypeTag[Int] + classManifestIsnotConcreteTypeTag[String] + classManifestIsnotConcreteTypeTag[Array[Int]] +} \ No newline at end of file diff --git a/test/files/neg/interop_classtags_arenot_manifests.check b/test/files/neg/interop_classtags_arenot_manifests.check new file mode 100644 index 0000000000..95f6a94d4b --- /dev/null +++ b/test/files/neg/interop_classtags_arenot_manifests.check @@ -0,0 +1,7 @@ +interop_classtags_arenot_manifests.scala:3: error: No Manifest available for T. + println(manifest[T]) + ^ +interop_classtags_arenot_manifests.scala:11: error: No Manifest available for T. + println(manifest[T]) + ^ +two errors found diff --git a/test/files/neg/interop_classtags_arenot_manifests.scala b/test/files/neg/interop_classtags_arenot_manifests.scala new file mode 100644 index 0000000000..7351f7e305 --- /dev/null +++ b/test/files/neg/interop_classtags_arenot_manifests.scala @@ -0,0 +1,17 @@ +object Test extends App { + def arrayTagIsnotManifest[T: ArrayTag] = { + println(manifest[T]) + } + + arrayTagIsnotManifest[Int] + arrayTagIsnotManifest[String] + arrayTagIsnotManifest[Array[Int]] + + def classTagIsnotManifest[T: ClassTag] = { + println(manifest[T]) + } + + classTagIsnotManifest[Int] + classTagIsnotManifest[String] + classTagIsnotManifest[Array[Int]] +} \ No newline at end of file diff --git a/test/files/neg/interop_erasuretags_arenot_classmanifests.check b/test/files/neg/interop_erasuretags_arenot_classmanifests.check new file mode 100644 index 0000000000..4bb81108d1 --- /dev/null +++ b/test/files/neg/interop_erasuretags_arenot_classmanifests.check @@ -0,0 +1,4 @@ +interop_erasuretags_arenot_classmanifests.scala:3: error: could not find implicit value for parameter m: ClassManifest[T] + println(classManifest[T]) + ^ +one error found diff --git a/test/files/neg/interop_erasuretags_arenot_classmanifests.scala b/test/files/neg/interop_erasuretags_arenot_classmanifests.scala new file mode 100644 index 0000000000..cf7d1ac257 --- /dev/null +++ b/test/files/neg/interop_erasuretags_arenot_classmanifests.scala @@ -0,0 +1,9 @@ +object Test extends App { + def erasureTagIsnotClassManifest[T: ErasureTag] = { + println(classManifest[T]) + } + + erasureTagIsnotClassManifest[Int] + erasureTagIsnotClassManifest[String] + erasureTagIsnotClassManifest[Array[Int]] +} \ No newline at end of file diff --git a/test/files/neg/interop_erasuretags_arenot_manifests.check b/test/files/neg/interop_erasuretags_arenot_manifests.check new file mode 100644 index 0000000000..da3c03d371 --- /dev/null +++ b/test/files/neg/interop_erasuretags_arenot_manifests.check @@ -0,0 +1,4 @@ +interop_erasuretags_arenot_manifests.scala:3: error: No Manifest available for T. + println(manifest[T]) + ^ +one error found diff --git a/test/files/neg/interop_erasuretags_arenot_manifests.scala b/test/files/neg/interop_erasuretags_arenot_manifests.scala new file mode 100644 index 0000000000..5c326549d8 --- /dev/null +++ b/test/files/neg/interop_erasuretags_arenot_manifests.scala @@ -0,0 +1,9 @@ +object Test extends App { + def erasureTagIsnotManifest[T: ErasureTag] = { + println(manifest[T]) + } + + erasureTagIsnotManifest[Int] + erasureTagIsnotManifest[String] + erasureTagIsnotManifest[Array[Int]] +} \ No newline at end of file diff --git a/test/files/neg/interop_typetags_arenot_classmanifests.check b/test/files/neg/interop_typetags_arenot_classmanifests.check new file mode 100644 index 0000000000..9ed4fd43d4 --- /dev/null +++ b/test/files/neg/interop_typetags_arenot_classmanifests.check @@ -0,0 +1,4 @@ +interop_typetags_arenot_classmanifests.scala:3: error: could not find implicit value for parameter m: ClassManifest[T] + println(classManifest[T]) + ^ +one error found diff --git a/test/files/neg/interop_typetags_arenot_classmanifests.scala b/test/files/neg/interop_typetags_arenot_classmanifests.scala new file mode 100644 index 0000000000..b1fbb7b5a6 --- /dev/null +++ b/test/files/neg/interop_typetags_arenot_classmanifests.scala @@ -0,0 +1,9 @@ +object Test extends App { + def typeTagIsnotClassManifest[T: TypeTag] = { + println(classManifest[T]) + } + + typeTagIsnotClassManifest[Int] + typeTagIsnotClassManifest[String] + typeTagIsnotClassManifest[Array[Int]] +} \ No newline at end of file diff --git a/test/files/neg/interop_typetags_arenot_manifests.check b/test/files/neg/interop_typetags_arenot_manifests.check new file mode 100644 index 0000000000..7761a747ff --- /dev/null +++ b/test/files/neg/interop_typetags_arenot_manifests.check @@ -0,0 +1,4 @@ +interop_typetags_arenot_manifests.scala:3: error: No Manifest available for T. + println(manifest[T]) + ^ +one error found diff --git a/test/files/neg/interop_typetags_arenot_manifests.scala b/test/files/neg/interop_typetags_arenot_manifests.scala new file mode 100644 index 0000000000..4e2a04489b --- /dev/null +++ b/test/files/neg/interop_typetags_arenot_manifests.scala @@ -0,0 +1,9 @@ +object Test extends App { + def typeTagIsnotManifest[T: TypeTag] = { + println(manifest[T]) + } + + typeTagIsnotManifest[Int] + typeTagIsnotManifest[String] + typeTagIsnotManifest[Array[Int]] +} \ No newline at end of file diff --git a/test/files/run/interop_classmanifests_arepartially_typetags.check b/test/files/run/interop_classmanifests_arepartially_typetags.check new file mode 100644 index 0000000000..3dfcdccbec --- /dev/null +++ b/test/files/run/interop_classmanifests_arepartially_typetags.check @@ -0,0 +1,6 @@ +T +int +T +class java.lang.String +T +class [I diff --git a/test/files/run/interop_classmanifests_arepartially_typetags.scala b/test/files/run/interop_classmanifests_arepartially_typetags.scala new file mode 100644 index 0000000000..9bc1f32e86 --- /dev/null +++ b/test/files/run/interop_classmanifests_arepartially_typetags.scala @@ -0,0 +1,10 @@ +object Test extends App { + def classManifestIspartiallyTypeTag[T: ClassManifest] = { + println(typeTag[T].tpe) + println(typeTag[T].erasure) + } + + classManifestIspartiallyTypeTag[Int] + classManifestIspartiallyTypeTag[String] + classManifestIspartiallyTypeTag[Array[Int]] +} \ No newline at end of file diff --git a/test/files/run/interop_classtags_are_classmanifests.check b/test/files/run/interop_classtags_are_classmanifests.check new file mode 100644 index 0000000000..02393dff23 --- /dev/null +++ b/test/files/run/interop_classtags_are_classmanifests.check @@ -0,0 +1,6 @@ +Int +java.lang.String +Array[Int] +Int +java.lang.String +Array[Int] diff --git a/test/files/run/interop_classtags_are_classmanifests.scala b/test/files/run/interop_classtags_are_classmanifests.scala new file mode 100644 index 0000000000..309c99a3f5 --- /dev/null +++ b/test/files/run/interop_classtags_are_classmanifests.scala @@ -0,0 +1,17 @@ +object Test extends App { + def arrayTagIsClassManifest[T: ArrayTag] = { + println(classManifest[T]) + } + + arrayTagIsClassManifest[Int] + arrayTagIsClassManifest[String] + arrayTagIsClassManifest[Array[Int]] + + def classTagIsClassManifest[T: ClassTag] = { + println(classManifest[T]) + } + + classTagIsClassManifest[Int] + classTagIsClassManifest[String] + classTagIsClassManifest[Array[Int]] +} \ No newline at end of file diff --git a/test/files/run/interop_concretetypetags_are_classmanifests.check b/test/files/run/interop_concretetypetags_are_classmanifests.check new file mode 100644 index 0000000000..c59e92d4eb --- /dev/null +++ b/test/files/run/interop_concretetypetags_are_classmanifests.check @@ -0,0 +1,3 @@ +Int +java.lang.String +Array[Int] diff --git a/test/files/run/interop_concretetypetags_are_classmanifests.scala b/test/files/run/interop_concretetypetags_are_classmanifests.scala new file mode 100644 index 0000000000..b578d7e626 --- /dev/null +++ b/test/files/run/interop_concretetypetags_are_classmanifests.scala @@ -0,0 +1,9 @@ +object Test extends App { + def concreteTypeTagIsClassManifest[T: ConcreteTypeTag] = { + println(classManifest[T]) + } + + concreteTypeTagIsClassManifest[Int] + concreteTypeTagIsClassManifest[String] + concreteTypeTagIsClassManifest[Array[Int]] +} \ No newline at end of file diff --git a/test/files/run/interop_concretetypetags_are_manifests.check b/test/files/run/interop_concretetypetags_are_manifests.check new file mode 100644 index 0000000000..c59e92d4eb --- /dev/null +++ b/test/files/run/interop_concretetypetags_are_manifests.check @@ -0,0 +1,3 @@ +Int +java.lang.String +Array[Int] diff --git a/test/files/run/interop_concretetypetags_are_manifests.scala b/test/files/run/interop_concretetypetags_are_manifests.scala new file mode 100644 index 0000000000..731410bc10 --- /dev/null +++ b/test/files/run/interop_concretetypetags_are_manifests.scala @@ -0,0 +1,9 @@ +object Test extends App { + def concreteTypeTagIsManifest[T: ConcreteTypeTag] = { + println(manifest[T]) + } + + concreteTypeTagIsManifest[Int] + concreteTypeTagIsManifest[String] + concreteTypeTagIsManifest[Array[Int]] +} \ No newline at end of file diff --git a/test/files/run/interop_manifests_are_classtags.check b/test/files/run/interop_manifests_are_classtags.check new file mode 100644 index 0000000000..07ff6b984a --- /dev/null +++ b/test/files/run/interop_manifests_are_classtags.check @@ -0,0 +1,24 @@ +Int +Int +List() +List(0, 0, 0, 0, 0) +java.lang.String +java.lang.String +List() +List(null, null, null, null, null) +Array[Int] +Array[Int] +List() +List(null, null, null, null, null) +Int +Int +List() +List(0, 0, 0, 0, 0) +java.lang.String +java.lang.String +List() +List(null, null, null, null, null) +Array[Int] +Array[Int] +List() +List(null, null, null, null, null) diff --git a/test/files/run/interop_manifests_are_classtags.scala b/test/files/run/interop_manifests_are_classtags.scala new file mode 100644 index 0000000000..582cea3467 --- /dev/null +++ b/test/files/run/interop_manifests_are_classtags.scala @@ -0,0 +1,23 @@ +object Test extends App { + def classManifestIsClassTag[T: ClassManifest] = { + println(arrayTag[T]) + println(erasureTag[T]) + println(Array[T]().toList) + println(new Array[T](5).toList) + } + + classManifestIsClassTag[Int] + classManifestIsClassTag[String] + classManifestIsClassTag[Array[Int]] + + def manifestIsClassTag[T: Manifest] = { + println(arrayTag[T]) + println(erasureTag[T]) + println(Array[T]().toList) + println(new Array[T](5).toList) + } + + manifestIsClassTag[Int] + manifestIsClassTag[String] + manifestIsClassTag[Array[Int]] +} \ No newline at end of file diff --git a/test/files/run/interop_manifests_are_concretetypetags.check b/test/files/run/interop_manifests_are_concretetypetags.check new file mode 100644 index 0000000000..edab85ecf1 --- /dev/null +++ b/test/files/run/interop_manifests_are_concretetypetags.check @@ -0,0 +1,6 @@ +Int +int +String +class java.lang.String +Array[Int] +class [I diff --git a/test/files/run/interop_manifests_are_concretetypetags.scala b/test/files/run/interop_manifests_are_concretetypetags.scala new file mode 100644 index 0000000000..0b82a56d0a --- /dev/null +++ b/test/files/run/interop_manifests_are_concretetypetags.scala @@ -0,0 +1,10 @@ +object Test extends App { + def manifestIsConcreteTypeTag[T: Manifest] = { + println(concreteTypeTag[T].tpe) + println(concreteTypeTag[T].erasure) + } + + manifestIsConcreteTypeTag[Int] + manifestIsConcreteTypeTag[String] + manifestIsConcreteTypeTag[Array[Int]] +} \ No newline at end of file diff --git a/test/files/run/interop_manifests_are_typetags.check b/test/files/run/interop_manifests_are_typetags.check new file mode 100644 index 0000000000..edab85ecf1 --- /dev/null +++ b/test/files/run/interop_manifests_are_typetags.check @@ -0,0 +1,6 @@ +Int +int +String +class java.lang.String +Array[Int] +class [I diff --git a/test/files/run/interop_manifests_are_typetags.scala b/test/files/run/interop_manifests_are_typetags.scala new file mode 100644 index 0000000000..03a7b7b6d5 --- /dev/null +++ b/test/files/run/interop_manifests_are_typetags.scala @@ -0,0 +1,10 @@ +object Test extends App { + def manifestIsTypeTag[T: Manifest] = { + println(typeTag[T].tpe) + println(typeTag[T].erasure) + } + + manifestIsTypeTag[Int] + manifestIsTypeTag[String] + manifestIsTypeTag[Array[Int]] +} \ No newline at end of file -- cgit v1.2.3