summaryrefslogtreecommitdiff
path: root/test/files/run/t6318_primitives.check
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-09-06 21:05:17 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-09-06 23:19:20 +0200
commit6a740332c7bfd56b20993be6ecd0bf818104f56c (patch)
tree6884bd48506c9e2468d07cfcf7433121c04cfac2 /test/files/run/t6318_primitives.check
parentadf2d3632b07eef4fc2303aef994e66584a73f49 (diff)
downloadscala-6a740332c7bfd56b20993be6ecd0bf818104f56c.tar.gz
scala-6a740332c7bfd56b20993be6ecd0bf818104f56c.tar.bz2
scala-6a740332c7bfd56b20993be6ecd0bf818104f56c.zip
SI-6318 fixes ClassTag.unapply for primitives
ClassTag.unapply now has overloads for primitive value classes so that it can preserve boxiness when performing subtyping tests. First I wanted to annotate ClassTag.unapply with a ClassTag itself, i.e. to transform its signature from "def unapply(x: Any): Option[T]" to "def unapply[U: ClassTag](x: U): Option[T]". But then virtpatmat_typetag.scala exhibited a nasty problem. When pattern matching with this unapply, patmat first infers U as something and then tries to pattern match against this inferred type. And if U gets inferred as an abstract type itself, bad things happen: warning: The outer reference in this type test cannot be checked at run time. That's why I decided to drop the ClassTag idea and go with 9 extra overloads. Not very beautiful, but definitely robust.
Diffstat (limited to 'test/files/run/t6318_primitives.check')
-rw-r--r--test/files/run/t6318_primitives.check36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/files/run/t6318_primitives.check b/test/files/run/t6318_primitives.check
new file mode 100644
index 0000000000..bb474c3bdc
--- /dev/null
+++ b/test/files/run/t6318_primitives.check
@@ -0,0 +1,36 @@
+true
+Some(1)
+false
+None
+true
+Some(1)
+false
+None
+true
+Some()
+false
+None
+true
+Some(1)
+false
+None
+true
+Some(1)
+false
+None
+true
+Some(1.0)
+false
+None
+true
+Some(1.0)
+false
+None
+true
+Some(true)
+false
+None
+true
+Some(())
+false
+None