diff options
author | Martin Odersky <odersky@gmail.com> | 2009-09-10 15:39:11 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-09-10 15:39:11 +0000 |
commit | e72f0c7f2ff54f2afff3b612e7e9f9572ce3c82f (patch) | |
tree | d6f07e52e994609c8fc81624a987cc92a66b49b4 /test/files | |
parent | 5f5b82e792094d3d51985167f96742f4ea210a31 (diff) | |
download | scala-e72f0c7f2ff54f2afff3b612e7e9f9572ce3c82f.tar.gz scala-e72f0c7f2ff54f2afff3b612e7e9f9572ce3c82f.tar.bz2 scala-e72f0c7f2ff54f2afff3b612e7e9f9572ce3c82f.zip |
Massive redesign so that: scala> "hi" == "hi".r...
Massive redesign so that: scala> "hi" == "hi".reverse.reverse gives: res0: Boolean = true
Preparing to do similar things to arrays.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/implicits.scala | 23 | ||||
-rw-r--r-- | test/files/run/t2212.scala.disabled (renamed from test/files/run/t2212.scala) | 0 |
2 files changed, 23 insertions, 0 deletions
diff --git a/test/files/run/implicits.scala b/test/files/run/implicits.scala index 3fd3561fe7..e554575284 100644 --- a/test/files/run/implicits.scala +++ b/test/files/run/implicits.scala @@ -23,3 +23,26 @@ object Test extends Application { Console.println(s) Console.println(2: String) } + +object TestPriority { + + class C(x: Int) { def foo: Int = x + 1 } + + class D(x: Int) { def foo: Int = x + 2 } + + class IMPL { + implicit def Int2C(x: Int): C = new C(x) + } + + object impl extends IMPL { + implicit def Int2D(x: Int): D = new D(x) + } + + import impl._ + + val x: C = 2 + val y: D = 2 + assert(x.foo == 3, x.foo) + assert(y.foo == 4, y.foo) + assert((2).foo == 4, (2).foo) +} diff --git a/test/files/run/t2212.scala b/test/files/run/t2212.scala.disabled index 5f4447fa2b..5f4447fa2b 100644 --- a/test/files/run/t2212.scala +++ b/test/files/run/t2212.scala.disabled |