# See code from \`@generated\` function

**URL:** <https://discourse.julialang.org/t/see-code-from-generated-function/5033>\
**Category:** General Usage\
**Tags:** question\
**Created:** [July 24, 2017, 1:10am UTC](https://discourse.julialang.org/t/see-code-from-generated-function/5033 "2017-07-24T01:10:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![greg\_plowman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/greg_plowman/32/8100_2.png) [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Post date:** [July 24, 2017, 1:10am UTC](https://discourse.julialang.org/t/see-code-from-generated-function/5033/1 "2017-07-24T01:10:22Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [July 24, 2017, 1:17am UTC](https://discourse.julialang.org/t/see-code-from-generated-function/5033/2 "2017-07-24T01:17:12Z")

</div>

`code_typed` currently does that, also [https://github.com/JuliaLang/julia/issues/22874](https://github.com/JuliaLang/julia/issues/22874).
