Hi, maybe this one can help you: Constraints for `@generated` function - #2 by cscherrer
Also this one: Eval of Julia code · The Julia Language
“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 ) 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.