aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/implicits1.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-09-05 15:36:25 +0200
committerMartin Odersky <odersky@gmail.com>2013-09-05 15:37:57 +0200
commitf7ab848229e8b9b0de1b719725816209aa1271c8 (patch)
tree2d7ea759ed63413e8b6ac19cff8eea930797f412 /tests/pos/implicits1.scala
parent441613bd49f9b5629eefffdc30a52869c0732ca0 (diff)
downloaddotty-f7ab848229e8b9b0de1b719725816209aa1271c8.tar.gz
dotty-f7ab848229e8b9b0de1b719725816209aa1271c8.tar.bz2
dotty-f7ab848229e8b9b0de1b719725816209aa1271c8.zip
Several fixes in typer.
Also updated tests.
Diffstat (limited to 'tests/pos/implicits1.scala')
-rw-r--r--tests/pos/implicits1.scala10
1 files changed, 10 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