Open Roger-luo opened 1 year ago
I already checked fn.kwargs is not nothing but it seems JET still does a union split on fn.kwargs and reporting false positive on method call of nothing here
fn.kwargs
nothing
https://github.com/Roger-luo/Expronicon.jl/blob/main/src/codegen.jl#L65
reported via
JET.report_package("Expronicon")
related results
┌ @ /Users/roger/Code/Julia/Expronicon/src/codegen.jl:67 fn.kwargs[1] │ no matching method found `getindex(::Nothing, ::Int64)` (1/2 union split): ((fn::Expronicon.JLFunction).kwargs::Union{Nothing, Vector{Any}})[1] └──────────────────────────────────────────────────────── ┌ @ /Users/roger/Code/Julia/Expronicon/src/codegen.jl:68 fn.kwargs[1] │ no matching method found `getindex(::Nothing, ::Int64)` (1/2 union split): ((fn::Expronicon.JLFunction).kwargs::Union{Nothing, Vector{Any}})[1] └────────────────────────────────────────────────────────
If you define JLFunction as immutable struct, JET should no longer report the issue. Fixing this for mutable case requires escape analysis.
JLFunction
I already checked
fn.kwargs
is notnothing
but it seems JET still does a union split onfn.kwargs
and reporting false positive on method call ofnothing
herehttps://github.com/Roger-luo/Expronicon.jl/blob/main/src/codegen.jl#L65
reported via
related results