summaryrefslogtreecommitdiff
path: root/test/files/run/virtpatmat_stringinterp.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/virtpatmat_stringinterp.scala')
-rw-r--r--test/files/run/virtpatmat_stringinterp.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/files/run/virtpatmat_stringinterp.scala b/test/files/run/virtpatmat_stringinterp.scala
new file mode 100644
index 0000000000..213712f17a
--- /dev/null
+++ b/test/files/run/virtpatmat_stringinterp.scala
@@ -0,0 +1,13 @@
+object Test extends App {
+ 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) }
+} \ No newline at end of file