diff options
Diffstat (limited to 'tests/run/virtpatmat_stringinterp.scala')
-rw-r--r-- | tests/run/virtpatmat_stringinterp.scala | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/run/virtpatmat_stringinterp.scala b/tests/run/virtpatmat_stringinterp.scala new file mode 100644 index 000000000..6ce1bf9c5 --- /dev/null +++ b/tests/run/virtpatmat_stringinterp.scala @@ -0,0 +1,16 @@ + +import scala.language.{ implicitConversions } + +object Test extends dotty.runtime.LegacyApp { + case class Node(x: Int) + + implicit def sc2xml(sc: StringContext): XMLContext = new XMLContext(sc) + class XMLContext(sc: StringContext) { + object xml { + def unapplySeq(xml: Node): Option[Seq[Node]] = Some(List(Node(1))) + } + } + + val x: Node = Node(0) + x match { case xml"""<foo arg=$a/>""" => println(a) } +} |