From 7b06546f88efc868bb5d80db3b56a5c81a20a86f Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Mon, 13 Nov 2006 09:55:48 +0000 Subject: Added test for bug 891 (unboxing and promotion) --- test/files/run/promotion.check | 2 ++ test/files/run/promotion.scala | 12 ++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 test/files/run/promotion.check create mode 100644 test/files/run/promotion.scala 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 + }}); + } +} -- cgit v1.2.3