-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
I am seeing this in a JET report for AbstractAlgebra:
││││┌ convert(::Type{OrdinalRange{Int64, Int64}}, r::OrdinalRange{<:Integer, <:Integer}) @ Base ./range.jl:276
│││││┌ OrdinalRange{Int64, Int64}(r::OrdinalRange{<:Integer, <:Integer}) @ Base ./range.jl:1315
││││││┌ StepRange{Int64, Int64}(r::OrdinalRange{<:Integer, <:Integer}) @ Base ./range.jl:1327
│││││││┌ StepRange{Int64, Int64}(start::Any, step::Any, stop::Any) @ Base ./range.jl:336
││││││││┌ steprange_last(start::Any, step::Any, stop::Any) @ Base ./range.jl:365
│││││││││┌ (::Base.var"#overflow_case#steprange_last##0")(absdiff::Signed, absstep::Any) @ Base ./range.jl:364
││││││││││┌ unsigned(x::Union{Int128, Int16, Int32, Int64, Int8}) @ Base ./int.jl:216
│││││││││││┌ reinterpret(::Union{Type{…}, Type{…}, Type{…}, Type{…}, Type{…}}, x::Union{Int128, Int16, Int32, Int64, Int8}) @ Base ./essentials.jl:733
││││││││││││ bitcast: target type not a leaf primitive type: Base.bitcast(Out::Union{Type{UInt128}, Type{UInt16}, Type{UInt32}, Type{UInt64}, Type{UInt8}}, x::Union{Int128, Int16, Int32, Int64, Int8})
│││││││││││└────────────────────
Alas the code in essentials.jl:733 that JET complains about, the type Out in question is guarded by an isprimitivetype(Out) check.
function reinterpret(::Type{Out}, x) where {Out}
@inline
if isprimitivetype(Out) && isprimitivetype(typeof(x))
return bitcast(Out, x) # <-- this is the line 733 it complains about
end
# only available when Base is fully loaded.
return _reinterpret(Out, x)
endPerhaps JET could / should catch that pattern?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels