summaryrefslogtreecommitdiff
path: root/test/files/run/valueclasses-classtag-existential.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-07-17 18:04:23 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-07-17 19:17:15 +0200
commit06b373878a044e0a83e5162bca661a6050957d04 (patch)
treed4acc6da509d271a3bb481694fca2d1f5f64fce0 /test/files/run/valueclasses-classtag-existential.scala
parent0cfd858a38ddf0ac83d9bbefe85110f88dc707c0 (diff)
downloadscala-06b373878a044e0a83e5162bca661a6050957d04.tar.gz
scala-06b373878a044e0a83e5162bca661a6050957d04.tar.bz2
scala-06b373878a044e0a83e5162bca661a6050957d04.zip
SI-5731 a few fixes for value classes
I've faced two gotchas. First of all posterasure, which is supposed to erase ErasedValueType types, didn't look into ConstantType.value that is known to be smuggling types (hi Paul that's a plus one). Secondly ClassManifest.classType[T] assumed that its T is bound by AnyRef, which is not the case for value types. Here I had two choices: a) introduce a special method for manifests of value types, b) remove the upper bound of the type parameter and call it a day. Since manifests are already deprecated and there's no difference which method was used to create which manifest, I went for option b).
Diffstat (limited to 'test/files/run/valueclasses-classtag-existential.scala')
-rw-r--r--test/files/run/valueclasses-classtag-existential.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/files/run/valueclasses-classtag-existential.scala b/test/files/run/valueclasses-classtag-existential.scala
new file mode 100644
index 0000000000..e0db9cdd75
--- /dev/null
+++ b/test/files/run/valueclasses-classtag-existential.scala
@@ -0,0 +1,5 @@
+class Foo[T](val x: T) extends AnyVal
+
+object Test extends App {
+ println(scala.reflect.classTag[Foo[_]])
+} \ No newline at end of file