In Scala 3 how can I extract a Match
(or UnApply
) from a ValDef tree in a compiler plugin? In Scala 2 we do
override def transform(tree: Tree) {
tree match {
...
case dd @ ValDef(mods, name, tpt, rhs @ Match(_, _)) => ...
}
}
and that works fine for something like val (a, b) = (1, 2)