title: Any way to 'expand' a generated function in Julia?
body: <p>Is there a way to get the expression that a Julia generated function creates without evaluating it, something like <code>@macroexpand</code> but for generated functions?</p>
  <p>For example, say we have</p>
  <pre><code>@generated function blah(x)
      if x &lt;:Integer
          :(x)
      else
          :(x * 2)
      end
  end
  </code></pre>
  <p>Then:</p>
  <pre><code>julia&gt; blah(1), blah(2.)
  (1, 4.0)
  </code></pre>
  <p>What I want is a macro that works something like:</p>
  <pre><code>julia&gt; @generatedexpand blah(2.)
  :(x * 2)
  </code></pre>