Skip to content

Commit 7583f76

Browse files
committed
Added test for implicits which fail in Scala 2.11.
Mentioned in scala-user by Haoyi Li on 12-Mar-2014
1 parent db950e5 commit 7583f76

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/pos/implicits1.scala

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,19 @@ object Implicits {
3535
val c: Int = y.elem
3636

3737
val d: Int = z.foo("abc")
38-
38+
3939
//import X.BarDeco
4040

4141
println(z.bar)
4242

43-
val e: Int = z.foo(true)
43+
val e: Int = z.foo(true)
44+
45+
// Haoyi Li's example on scala-user:
46+
47+
trait Modifier
48+
49+
implicit def stringNode(v: String): Modifier = new Modifier {}
50+
51+
val s: Modifier = Some("rd").getOrElse("")
4452

4553
}

0 commit comments

Comments
 (0)