diff options
author | Martin Odersky <odersky@gmail.com> | 2013-09-05 15:36:25 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-09-05 15:37:57 +0200 |
commit | f7ab848229e8b9b0de1b719725816209aa1271c8 (patch) | |
tree | 2d7ea759ed63413e8b6ac19cff8eea930797f412 /tests | |
parent | 441613bd49f9b5629eefffdc30a52869c0732ca0 (diff) | |
download | dotty-f7ab848229e8b9b0de1b719725816209aa1271c8.tar.gz dotty-f7ab848229e8b9b0de1b719725816209aa1271c8.tar.bz2 dotty-f7ab848229e8b9b0de1b719725816209aa1271c8.zip |
Several fixes in typer.
Also updated tests.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pos/implicits1.scala | 10 | ||||
-rw-r--r-- | tests/pos/inferred.scala | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/pos/implicits1.scala b/tests/pos/implicits1.scala index 2f0399b74..76d9dfd25 100644 --- a/tests/pos/implicits1.scala +++ b/tests/pos/implicits1.scala @@ -2,6 +2,12 @@ class X(val elem: Int) { def foo(y: String): Int = y.length + elem } +object X { + implicit class BarDeco(x: X) { + def bar: String = "!" + } +} + object Implicits { implicit val impl: X = new X(0) @@ -29,6 +35,10 @@ object Implicits { val c: Int = y.elem val d: Int = z.foo("abc") + + import X.BarDeco + + println(z.bar) // val e: Int = z.foo(true) not yet diff --git a/tests/pos/inferred.scala b/tests/pos/inferred.scala index 295cc9b49..c138a8e53 100644 --- a/tests/pos/inferred.scala +++ b/tests/pos/inferred.scala @@ -12,4 +12,8 @@ object Inferred { val nn = bar(Nil) + val ints: List[Int] = 1 :: Nil + + val a = if (1 == 0) Nil else ints + } |