JET.jl reports run-time dispatch errors for every println
, even if the println line in question is not reached. Is that desired? (it makes harder to check for errors in any package that prints information optionally for debugging, like many optimization routines do).
julia> function f(x,c)
if c
println("c is true")
end
return x + 1
end
f (generic function with 1 method)
julia> @report_opt f(1,false)
═════ 6 possible errors found ═════
┌ @ REPL[4]:3 Main.println("c is true")
│┌ @ coreio.jl:4 Base.println(Core.tuple(Core.typeassert(Base.stdout, Base.IO)), xs...)
││┌ @ strings/io.jl:75 Base.print(Core.tuple(io), xs, Core.tuple("\n")...)
│││┌ @ strings/io.jl:43 Base.lock(io)
││││┌ @ show.jl:334 Base.lock(Base.getproperty(io, :io))
│││││┌ @ stream.jl:282 Base.lock(Base.getproperty(s, :lock))
││││││┌ @ lock.jl:100 Base.wait(Base.getproperty(rl, :cond_wait))
│││││││┌ @ condition.jl:123 = Base.wait()
││││││││┌ @ task.jl:837 result = Base.try_yieldto(Base.ensure_rescheduled)
│││││││││┌ @ task.jl:774 Base.getproperty(%7, :result)
││││││││││ runtime dispatch detected: Base.getproperty(%7::Task, :result::Symbol)
│││││││││└───────────────
│││││││││┌ @ task.jl:775 Base.setproperty!(%7, :result, Base.nothing)
││││││││││ runtime dispatch detected: Base.setproperty!(%7::Task, :result::Symbol, Base.nothing)
│││││││││└───────────────
│││││││││┌ @ task.jl:776 Base.setproperty!(%7, :_isexception, false)
││││││││││ runtime dispatch detected: Base.setproperty!(%7::Task, :_isexception::Symbol, false)
│││││││││└───────────────
│││││││┌ @ condition.jl:125 Base.list_deletefirst!(Base.getproperty(ct, :queue), ct)
││││││││┌ @ linked_list.jl:145 Base.isequal(Base.getproperty(h, :value), val)
│││││││││┌ @ gcutils.jl:4 Base.isequal(%1, v)
││││││││││ runtime dispatch detected: Base.isequal(%1::Any, v::Task)
│││││││││└────────────────
│││││││┌ @ condition.jl:125 Base.list_deletefirst!(%25, %19)
││││││││ runtime dispatch detected: Base.list_deletefirst!(%25::Any, %19::Task)
│││││││└────────────────────
│┌ @ coreio.jl:4 Base.println(%3, %4)
││ runtime dispatch detected: Base.println(%3::IO, %4::String)
│└───────────────