Is there a way to get the expression that a Julia generated function creates without evaluating it, something like @macroexpand but for generated functions?
For example, say we have
@generated function blah(x)
if x <:Integer
:(x)
else
:(x * 2)
end
end
Then:
julia> blah(1), blah(2.)
(1, 4.0)
What I want is a macro that works something like:
julia> @generatedexpand blah(2.)
:(x * 2)