Skip to content
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

false positive: InferenceErrorReport on @kwdef parametrized struct #563

Open
dpinol opened this issue Aug 28, 2023 · 1 comment
Open

false positive: InferenceErrorReport on @kwdef parametrized struct #563

dpinol opened this issue Aug 28, 2023 · 1 comment

Comments

@dpinol
Copy link
Contributor

dpinol commented Aug 28, 2023

A false positive is reported by JET 0.8.12 (also in 0.8.14) which did not appear on 0.8.11. Reproducible in julia 1.9.3 & 1.10.0beta3

module ParametrizedKwdef

    Base.@kwdef mutable struct ST{O <: Number}
        sum::O = zero(O)
    end
end # module ParametrizedKwdef

I attach full project
ParametrizedKwdef.zip

julia> JET.report_package("ParametrizedKwdef")
[toplevel-info] virtualized the context of Main (took 0.009 sec)
[toplevel-info] entered into /home/dani/dev/julia/jet/issues/ParametrizedKwdef/src/ParametrizedKwdef.jl
[toplevel-info]  exited from /home/dani/dev/julia/jet/issues/ParametrizedKwdef/src/ParametrizedKwdef.jl (took 0.328 sec)
[toplevel-info] analyzing from top-level definitions (8/8)
[toplevel-info] analyzed 8 top-level definitions (took 0.479 sec)
═════ 2 possible errors found ═════
┌ ParametrizedKwdef.ST() @ ParametrizedKwdef ./util.jl:578`ParametrizedKwdef.O` is not defined: ParametrizedKwdef.zero(ParametrizedKwdef.O)
└────────────────────
┌ kwcall(::Any, ::Type{ParametrizedKwdef.ST}) @ ParametrizedKwdef ./util.jl:578`ParametrizedKwdef.O` is not defined: @_5 = ParametrizedKwdef.zero(ParametrizedKwdef.O)
@dpinol
Copy link
Contributor Author

dpinol commented Feb 27, 2024

Hi,
any news about this? It still occurs in julia 1.10 and JET v0.8.29

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant