-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JETAnalyzer: false positive errors that can be analyzed to be safe by concrete evaluation #444
Comments
I don't think this is an issue with JET, however, it may provide a option for improving JET. Here is a reduced MWE: julia> using JET
julia> f(::DataType) = false
f (generic function with 1 method)
julia> g(T::Type) = Base.isbitsunion(T) ? true : f(T)
g (generic function with 1 method)
julia> @report_call g(Union{Int, UInt})
═════ 1 possible error found ═════
┌ @ REPL[3]:1 f(T)
│ no matching method found `f(::Type{Union{Int64, UInt64}})`: f(T::Type{Union{Int64, UInt64}})
└───────────── Julia is not able to statically infer that The code in your OP example is intentionally marked as |
By allowing `hasuniquerep` to analyze `Union`-types. Motivated by <aviatesk/JET.jl#444>.
This seems simular
|
This issue appears solved on Julia master and the latest version of JET: julia> @report_call g(Union{Int, UInt})
No errors detected |
Yeah, #529 fixed this problem. Thanks for the reminder. |
By allowing `hasuniquerep` to analyze `Union`-types. Motivated by <aviatesk/JET.jl#444>.
On Julia nightly from today:
reports
═════ 1 possible error found ═════ ┌ @ REPL[7]:2 vec[2 : lastindex(vec)] │┌ @ array.jl:925 copyto!(X, firstindex(X), A, first(I), lI) ││┌ @ array.jl:319 Base._copyto_impl!(dest, doffs, src, soffs, n) │││┌ @ array.jl:327 unsafe_copyto!(dest, doffs, src, soffs, n) ││││┌ @ array.jl:281 srcp = pointer(src, soffs) │││││┌ @ abstractarray.jl:1243 Base._memory_offset(x, i) ││││││┌ @ abstractarray.jl:1247 Base.elsize(x) │││││││┌ @ abstractarray.jl:251 Base.elsize(Base.typeof(A)) ││││││││┌ @ array.jl:213 Base.aligned_sizeof(T) │││││││││┌ @ reflection.jl:415 al = Base.datatype_alignment(T) ││││││││││ no matching method found `datatype_alignment(::Type{Union{Float64, Int64, UInt8}})`: al = Base.datatype_alignment(T::Type{Union{Float64, Int64, UInt8}}) │││││││││└─────────────────────
Versions:
Julia nightly installed with unreleased juliaup (patched to support nightlies)
JET version v0.6.21
Should I be reporting things like this on the JET issue tracker or on the Julia one?
The text was updated successfully, but these errors were encountered: