summaryrefslogtreecommitdiff
path: root/test/files/pos/implicit-infix-ops.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-03-15 20:41:57 +0000
committerPaul Phillips <paulp@improving.org>2011-03-15 20:41:57 +0000
commitfe9a10c9a0f088f8dc5c47b9cfda51864ec884cc (patch)
tree65d219018dee9ed92d945b96bff4188f5b4dec9e /test/files/pos/implicit-infix-ops.scala
parent4bae7e8a9270b523cac7f325b76adbc71d4e138b (diff)
downloadscala-fe9a10c9a0f088f8dc5c47b9cfda51864ec884cc.tar.gz
scala-fe9a10c9a0f088f8dc5c47b9cfda51864ec884cc.tar.bz2
scala-fe9a10c9a0f088f8dc5c47b9cfda51864ec884cc.zip
Leveraged having a place to put some useful imp...
Leveraged having a place to put some useful implicits which we sensibly are reluctant to introduce in the default scope. The test case pretty much sums it up. import Ordering.Implicits._ import Numeric.Implicits._ 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) No review.
Diffstat (limited to 'test/files/pos/implicit-infix-ops.scala')
-rw-r--r--test/files/pos/implicit-infix-ops.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/files/pos/implicit-infix-ops.scala b/test/files/pos/implicit-infix-ops.scala
new file mode 100644
index 0000000000..ef4512fa6b
--- /dev/null
+++ b/test/files/pos/implicit-infix-ops.scala
@@ -0,0 +1,7 @@
+object Test {
+ import Ordering.Implicits._
+ import Numeric.Implicits._
+
+ 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)
+}