JuliaHEP / AwkwardArray.jl

Awkward Array in Julia mirrors the Python library, enabling effortless zero-copy data exchange between Julia and Python
https://juliahep.github.io/AwkwardArray.jl/dev/
MIT License
31 stars 2 forks source link

JET.jl reported error (UnionArray doesn't have `contents` property) #16

Closed Moelf closed 11 months ago

Moelf commented 1 year ago

Since AK.jl is very self-contained and has large amount of type-space operation, I decided to give https://github.com/aviatesk/JET.jl a go.

here's one of the only two errors (this is great!) it found:

julia> using JET

julia> report_package("AwkwardArray")
┌ getindex(layout::AwkwardArray.UnionArray, r::UnitRange{Int64}) @ AwkwardArray /tmp/AwkwardArray.jl/src/AwkwardArray.jl:1559
│┌ kwcall(::NamedTuple{(:tags, :index), <:Tuple{Any, Any}}, ::typeof(AwkwardArray.copy), layout::AwkwardArray.UnionArray{TAGS1, INDEX1, Union{}, BEHAVIOR}) where {TAGS1<:AbstractVector{Int8}, INDEX1<:Union{AbstractVector{Int32}, AbstractVector{Int64}, AbstractVector{UInt32}}, BEHAVIOR} @ AwkwardArray /tmp/AwkwardArray.jl/src/AwkwardArray.jl:1487
││┌ copy(layout::AwkwardArray.UnionArray{TAGS1, INDEX1, Union{}, BEHAVIOR}; tags::Union{AwkwardArray.Unset, AbstractVector{Int8}, TAGS2} where TAGS2<:AbstractVector{Int8}, index::Union{AwkwardArray.Unset, INDEX2} where INDEX2<:Union{AbstractVector{Int32}, AbstractVector{Int64}, AbstractVector{UInt32}}, contents::AwkwardArray.Unset, parameters::AwkwardArray.Unset, behavior::AwkwardArray.Unset) where {TAGS1<:AbstractVector{Int8}, INDEX1<:Union{AbstractVector{Int32}, AbstractVector{Int64}, AbstractVector{UInt32}}, BEHAVIOR} @ AwkwardArray /tmp/AwkwardArray.jl/src/AwkwardArray.jl:1510
│││┌ getproperty(x::AwkwardArray.UnionArray{TAGS1, INDEX1, Union{}} where {TAGS1<:AbstractVector{Int8}, INDEX1<:Union{AbstractVector{Int32}, AbstractVector{Int64}, AbstractVector{UInt32}}}, f::Symbol) @ Base ./Base.jl:37
││││ invalid builtin function call: Base.getfield(x::AwkwardArray.UnionArray{TAGS1, INDEX1, Union{}} where {TAGS1<:AbstractVector{Int8}, INDEX1<:Union{AbstractVector{Int32}, AbstractVector{Int64}, AbstractVector{UInt32}}}, f::Symbol)
│││└────────────────────

it's pointing to this line: https://github.com/jpivarski/AwkwardArray.jl/blob/fd5113f83430569645012b3151f3370b18dad672/src/AwkwardArray.jl#L1509-L1511

complaining about the fact that UnionArray doesn't have a field/property called contents https://github.com/jpivarski/AwkwardArray.jl/blob/fd5113f83430569645012b3151f3370b18dad672/src/AwkwardArray.jl#L1447-L1452

Moelf commented 1 year ago

oops, and I was gonna say it looks like a false positive @aviatesk