title: Use Scala macros to generate methods
body: <p>I want to generate aliases of methods using annotation macros in Scala 2.11+. I am not even sure that is even possible. If yes, how?</p>
  
  <p>Example - Given this below, I want the annotation macros to expand into</p>
  
  <pre><code>class Socket {
    @alias(aliases = Seq("!", "ask", "read"))
    def load(n: Int): Seq[Byte] = {/* impl */}
  }
  </code></pre>
  
  <p>I want the above to generate the synonym method stubs as follows:</p>
  
  <pre><code>class Socket {
    def load(n: Int): Seq[Byte] = // .... 
    def !(n: Int) = load(n)
    def ask(n: Int) = load(n)
    def read(n: Int) = load(n)
  }
  </code></pre>
  
  <p>The above is of course a facetious example but I can see this technique being useful to auto generate sync/async versions of APIs or in DSLs with lots of synonyms. Is it possible to also expose these generated methods in the Scaladoc too? Is this something possible using Scala meta?</p>
  
  <p>Note: What I am asking is quite different from: <a href="https://github.com/ktoso/scala-macro-method-alias" rel="nofollow noreferrer">https://github.com/ktoso/scala-macro-method-alias</a></p>
  
  <p>Also please don't mark this as a duplicate of <a href="https://stackoverflow.com/questions/13630366/scala-macros-add-function-to-class">this</a> as the question is a bit different and a lot has changed in Scala macro land in past 3 years.</p>