Closed valdisxp1 closed 7 years ago
This macros fails when lifting the quasiquote:
class addFields extends StaticAnnotation { inline def apply(defn: Any): Any = meta { val q"class $name { ..$stats }" = defn val main = q""" ..$stats private def a = 1 private[this] def b = 2 private[pack] def c = 3 protected def a1 = 1 protected[this] def b1 = 2 protected[pack] def c1 = 3 """ q"class $name { $main }" } }
Cause:
//Quotes.scala case m.Mod.Private(within) => // FIXME expected: Mod.Private.apply(within: String) got: Mod.Private.apply(within: Tree) selectToolbox("Mod.Private").appliedTo(lift(within)) case m.Mod.Protected(within) => // FIXME expected: Mod.Protected.apply(within: String) got: Mod.Private.apply(within: Tree) selectToolbox("Mod.Protected").appliedTo(lift(within))
This should be fixed by the latest PR.
Yes, it did fix the meta-type error. I an issue with private[this] and protected[this]. After #28 (merged) and #30 should work correctly.
private[this]
protected[this]
This macros fails when lifting the quasiquote:
Cause: