Open cossio opened 4 years ago
As a workaround,
using Cthulhu
@descend f(1)
and toggle
[v]erbose printing for warntype code
Generally, since we have Cthulhu.jl, @code_warntype
& friends may be considered primitives that one may not want to use directly in practice anyway for complex codebases --- perhaps the docstrings should mention Cthulhu?
@code_warntype
applied to a function with keyword arguments only prints a call to an internal function, so it does not provide any useful information. This has been discussed before, but I found no open issue tracking this:https://github.com/JuliaLang/julia/issues/24985 (closed) https://discourse.julialang.org/t/code-warntype-fails-when-function-has-a-keyword-argument/21907 https://discourse.julialang.org/t/use-of-code-warntype-on-a-function-with-keyword-arguments/5521
MWE:
Now compare the output of
@code_warntype
onf
(which takes a keyword argument) andg
(which doesn't). Onf
, the only printed code is a call to an internal function, whereasg
immediately shows where the type-instability lies.