# @code\_warntype result depending on compiled functions

**URL:** <https://discourse.julialang.org/t/code-warntype-result-depending-on-compiled-functions/105471>\
**Category:** General Usage\
**Tags:** question, code\_warntype, type-stability\
**Created:** [October 27, 2023, 8:55am UTC](https://discourse.julialang.org/t/code-warntype-result-depending-on-compiled-functions/105471 "2023-10-27T08:55:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco\_Lombardi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marco_lombardi/32/14608_2.png) [@Marco\_Lombardi](https://discourse.julialang.org/u/Marco_Lombardi)\
**Post date:** [October 27, 2023, 8:55am UTC](https://discourse.julialang.org/t/code-warntype-result-depending-on-compiled-functions/105471/1 "2023-10-27T08:55:16Z")

</div>

I am writing a fairly large project and I am trying to be very careful about type stability by checking all functions I write with `@code_warntype` and the JET tests. Doing these tests, I found something very strange that I cannot understand. Essentially, the result of `@code_warntype` on a function with exactly the same input depends on the order of compilation.

More specifically, say I am testing function `one`; I know that this function depends on another function, `two`. If, in a fresh Julia session, I check `@code_warntype one(arg1, arg2)`, I get a red line telling the result of this call is `Any`.

If, instead, on another fresh Julia session I first force the compilation of `two` by calling `@code_warntype two(arg3, arg4)` and then check `@code_wantype one(arg1, arg2)`, I do not get any red line: the result of `one` is `Float64`!

Sorry to be very generic here, but the project is quite large and finding a minimal working example is non-trivial.

Caveat: in the project I am using generated functions. Could that be at the origin of the issue I am finding?
