title: Is it possible for a macro on an abstract class or trait to be applied to all subclasses?
body: <p>Say I have some trait (or abstract class) <code>Foo</code> in a library that is commonly extended by user code and requires some method <code>numArgs</code>:</p>
  
  <pre class="lang-scala prettyprint-override"><code>trait Foo {
    // Number of arguments to the default constructor
    def numArgs: Int
  }
  </code></pre>
  
  <p>Now <code>numArgs</code> is trivial to write but it's obnoxious boiler plate that I'd like to generate. I can do this with reflection, but it's ugly and not portable to alternative backends like ScalaJS, ScalaNative, or GraalVM.</p>
  
  <p>Is it possible to write a macro annotation that I can apply <em>only</em> to <code>Foo</code> (<strong>not</strong> requiring it on every subclass of <code>Foo</code>) such that the method will be generated?</p>