summaryrefslogtreecommitdiff
path: root/test/files/run/promotion.scala
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2006-11-13 12:00:30 +0000
committermihaylov <mihaylov@epfl.ch>2006-11-13 12:00:30 +0000
commit6889ff9726f70bd9a0c87bf745b412bda5d379f2 (patch)
tree57606134d463cb20980e1bf9c1dfa4f9384a95aa /test/files/run/promotion.scala
parente008a32fb9e289594c1dd2a0c03324d3d5336570 (diff)
downloadscala-6889ff9726f70bd9a0c87bf745b412bda5d379f2.tar.gz
scala-6889ff9726f70bd9a0c87bf745b412bda5d379f2.tar.bz2
scala-6889ff9726f70bd9a0c87bf745b412bda5d379f2.zip
Improved the fix and test case for bug #819
Diffstat (limited to 'test/files/run/promotion.scala')
-rw-r--r--test/files/run/promotion.scala12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/files/run/promotion.scala b/test/files/run/promotion.scala
index 82b5265143..6e000c7f00 100644
--- a/test/files/run/promotion.scala
+++ b/test/files/run/promotion.scala
@@ -3,10 +3,12 @@
* 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
- }});
+
+ def id[A](x: A): A = x;
+ def main(args: Array[String]): Unit = {
+ Console.println(id(1) * 2.0)
+ Console.println(3.0 * id(2))
+ Console.println(id(4.0) * 5)
+ Console.println(6 * id(5.0))
}
}