From 5bb967a3de039830dcc453bb92d3b6a0b794684f Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sat, 19 Mar 2011 15:27:19 +0000 Subject: Some boundary conditions in range. infix implicits to Integral and Fractional. As a bonus this patch knocked 10,000 long boxings off a specialized test. Who knew. Closes #4308, #4321, review by community. --- test/files/pos/implicit-infix-ops.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/files/pos') diff --git a/test/files/pos/implicit-infix-ops.scala b/test/files/pos/implicit-infix-ops.scala index ef4512fa6b..66f3718e86 100644 --- a/test/files/pos/implicit-infix-ops.scala +++ b/test/files/pos/implicit-infix-ops.scala @@ -5,3 +5,19 @@ object Test { def f1[T: Numeric](x: T, y: T, z: T) = x + y + z def f2[T: Ordering](x: T, y: T, z: T) = if (x < y) (z > y) else (x < z) } + +object Int { + import Ordering.Implicits._ + import math.Integral.Implicits._ + + def f1[T: Integral](x: T, y: T, z: T) = (x + y + z) / z + def f2[T: Ordering](x: T, y: T, z: T) = if (x < y) (z > y) else (x < z) +} + +object Frac { + import Ordering.Implicits._ + import math.Fractional.Implicits._ + + def f1[T: Fractional](x: T, y: T, z: T) = (x + y + z) / z + def f2[T: Ordering](x: T, y: T, z: T) = if (x < y) (z > y) else (x < z) +} \ No newline at end of file -- cgit v1.2.3