diff --git a/tests/run/extmethods2.scala b/tests/run/extmethods2.scala new file mode 100644 index 000000000000..febfc169bcf4 --- /dev/null +++ b/tests/run/extmethods2.scala @@ -0,0 +1,17 @@ +object Test extends App { + + class TC + + implied StringListOps given TC { + type T = List[String] + def (x: T) foo (y: T) = (x ++ y, the[TC]) + def (x: T) bar (y: Int) = (x(0)(y), the[TC]) + } + + def test given TC = { + assert(List("abc").foo(List("def"))._1 == List("abc", "def")) + assert(List("abc").bar(2)._1 == 'c') + } + + test given TC() +} \ No newline at end of file