JET.jl
JET.jl copied to clipboard
False positive: accessing variables from other, possibly undefined modules
Consider code whose behavior depends on whether it is running on a notebook such as IJulia. Such a test is usually performed by inspecting a variable in the notebook's module. For example, IJulia's documentation recommends this code to test whether we're running in a notebook:
isdefined(Main, :IJulia) && Main.IJulia.inited
JET detects IJulia
as not defined:
═════ 1 possible error found ═════
┌ @ /home/mbaz/rcs/jdev/Gaston/src/Gaston.jl:87 Main.IJulia
│┌ @ Base.jl:31 Base.getglobal(x, f)
││ `IJulia` is not defined
│└──────────────
However, in practice this will never be a problem, since the IJulia
module is only accessed if it is defined.
Yes, this false positive is very annoying. I will try to fix it sometime in this week.