See code from `@generated` function

Is there a way to see the generated code from @generated functions?

Perhaps @generated_expand similar to @macroexpand ?

I know the documentation says in order to inspect the code, extract the body into another regular function:(https://docs.julialang.org/en/release-0.4/manual/metaprogramming/#an-advanced-example)

But it would be nice to be able to see code automatically.

code_typed currently does that, also https://github.com/JuliaLang/julia/issues/22874.

1 Like