diff options
Diffstat (limited to 'tests/run/t6260.scala')
-rw-r--r-- | tests/run/t6260.scala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/run/t6260.scala b/tests/run/t6260.scala new file mode 100644 index 000000000..3ad4926c8 --- /dev/null +++ b/tests/run/t6260.scala @@ -0,0 +1,12 @@ +class Box[X <: CharSequence](val x: X) extends AnyVal { + def map[Y <: CharSequence](f: X => Y): Box[Y] = + ((bx: Box[X]) => new Box(f(bx.x)))(this) + override def toString = s"Box($x)" +} + +object Test { + def main(args: Array[String]): Unit = { + val g = (x: String) => x + x + println(new Box("abc") map g) + } +} |