diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2006-11-13 09:55:48 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2006-11-13 09:55:48 +0000 |
commit | 7b06546f88efc868bb5d80db3b56a5c81a20a86f (patch) | |
tree | 978fe4ba5156382df2c4658c2a5885f69164e4aa /test | |
parent | 166fc61a6e070ab2ebb104d53919e5342c8ed596 (diff) | |
download | scala-7b06546f88efc868bb5d80db3b56a5c81a20a86f.tar.gz scala-7b06546f88efc868bb5d80db3b56a5c81a20a86f.tar.bz2 scala-7b06546f88efc868bb5d80db3b56a5c81a20a86f.zip |
Added test for bug 891 (unboxing and promotion)
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/promotion.check | 2 | ||||
-rw-r--r-- | test/files/run/promotion.scala | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/test/files/run/promotion.check b/test/files/run/promotion.check new file mode 100644 index 0000000000..59d4f84f5f --- /dev/null +++ b/test/files/run/promotion.check @@ -0,0 +1,2 @@ +B +List(2.0) 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 + }}); + } +} |