@code_warntype not found

When I use @code_warntype from the command line, it is found.
However, when I insert it into my script and run the script from the commandline via

julia script.jl

then, @code_warntype is not found. What am I missing? Thanks!

Using InteractiveUtils

To slightly elaborate on the above, correct, answer, the @code_* macros come from the InteractiveUtils standard library, which is loaded automatically when you work in the REPL. This is why you don’t need to explicitly load the module to use those macros in that environment.

1 Like

Thank you! I added InteractiveUtils and now all works as expected.

1 Like