# Generated functions and reflection

**URL:** <https://discourse.julialang.org/t/generated-functions-and-reflection/111301>\
**Category:** Internals & Design\
**Created:** [March 7, 2024, 2:39pm UTC](https://discourse.julialang.org/t/generated-functions-and-reflection/111301 "2024-03-07T14:39:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![apieum](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/apieum/32/2928_2.png) [@apieum](https://discourse.julialang.org/u/apieum)\
**Post date:** [March 7, 2024, 9:49pm UTC](https://discourse.julialang.org/t/generated-functions-and-reflection/111301/2 "2024-03-07T21:49:50Z")

</div>

Hi, maybe this one can help you: [Constraints for `@generated` function - #2 by cscherrer](https://discourse.julialang.org/t/constraints-for-generated-function/27967/2)

Also this one: [Eval of Julia code · The Julia Language](https://docs.julialang.org/en/v1/devdocs/eval/#dev-type-inference)

“a generated function gets expanded at a time when the types of the arguments are known”, `code_ircode_by_type` calls `typeinf_ircode` ([julia/base/compiler/typeinfer.jl at master · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/blob/master/base/compiler/typeinfer.jl#L975) ) so I guess the types of the arguments are not known at this time and the function is not expanded. Someone with a better understanding than me can probably confirm.

---

_[View the full topic](https://discourse.julialang.org/t/generated-functions-and-reflection/111301)._
