summaryrefslogtreecommitdiff
path: root/test/files/run/promotion.scala
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2006-11-13 09:55:48 +0000
committerIulian Dragos <jaguarul@gmail.com>2006-11-13 09:55:48 +0000
commit7b06546f88efc868bb5d80db3b56a5c81a20a86f (patch)
tree978fe4ba5156382df2c4658c2a5885f69164e4aa /test/files/run/promotion.scala
parent166fc61a6e070ab2ebb104d53919e5342c8ed596 (diff)
downloadscala-7b06546f88efc868bb5d80db3b56a5c81a20a86f.tar.gz
scala-7b06546f88efc868bb5d80db3b56a5c81a20a86f.tar.bz2
scala-7b06546f88efc868bb5d80db3b56a5c81a20a86f.zip
Added test for bug 891 (unboxing and promotion)
Diffstat (limited to 'test/files/run/promotion.scala')
-rw-r--r--test/files/run/promotion.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/files/run/promotion.scala b/test/files/run/promotion.scala
new file mode 100644
index 0000000000..82b5265143
--- /dev/null
+++ b/test/files/run/promotion.scala
@@ -0,0 +1,12 @@
+
+/** Test that unboxing and promotion (from int to double) work together.
+ * Was bug 891.
+ */
+object Test {
+ def main(args:Array[String]):Unit = {
+ Console println
+ List(Pair(1,2.0)).map[double]({ x => x match {
+ case Pair(a, x) => Console.println("B"); x * a
+ }});
+ }
+}