aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/pos/implicits1.scala12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/pos/implicits1.scala b/tests/pos/implicits1.scala
index 8791d61e6..47b7f1c52 100644
--- a/tests/pos/implicits1.scala
+++ b/tests/pos/implicits1.scala
@@ -35,11 +35,19 @@ 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)
+ val e: Int = z.foo(true)
+
+ // Haoyi Li's example on scala-user:
+
+ trait Modifier
+
+ implicit def stringNode(v: String): Modifier = new Modifier {}
+
+ val s: Modifier = Some("rd").getOrElse("")
}