summaryrefslogtreecommitdiff
path: root/test/files/pos/t8934a/A_1.scala
blob: 6c1f29d030749fd0f603be93a9a7f2522d13ceca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import language.experimental.macros
import reflect.macros.whitebox.Context

object Unapply {
  def impl1(c: Context)(a: c.Tree): c.Tree = {
    import c.universe._
    q"(new { def unapply[T](a: String): Option[(Int, String)] = ??? }).unapply($a)"
  }
  def unapply(a: Any): Any = macro impl1
}

object UnapplySeq {
  def impl1(c: Context)(a: c.Tree): c.Tree = {
    import c.universe._
    q"(new { def unapplySeq[T](a: String): Option[(Int, Seq[String])] = ??? }).unapplySeq($a)"
  }
  def unapplySeq(a: Any): Any = macro impl1
}