```scala // Macro_1.scala package macros import scala.quoted._ var saved = Option.empty[Expr[Any]] def oops(c: Expr[Any])(using QuoteContext) = { if saved.isEmpty then saved = Some(c) c else saved.get } inline def test(c: Any) = ${oops('c)} ``` ```scala // Test_2.scala object Test { class A(x: Int) { macros.test(x) } class B(y: String) { macros.test(y) } } ``` _Originally posted by @LPTK in https://github.com/lampepfl/dotty/issues/7142#issuecomment-582510588_