summaryrefslogtreecommitdiff
path: root/test/files/run/virtpatmat_stringinterp.scala
blob: 213712f17a081ee4b9e8b0c6f8a2015560661804 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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) }
}