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

Invalidation from == method #174

Open
matbesancon opened this issue Jul 20, 2021 · 4 comments
Open

Invalidation from == method #174

matbesancon opened this issue Jul 20, 2021 · 4 comments

Comments

@matbesancon
Copy link

matbesancon commented Jul 20, 2021

Same flavour as #144, I discovered the invalidation in a downstream package:

 inserting ==(a, b::Intervals.Endpoint) in Intervals at /home/mbesancon/.julia/packages/Intervals/ua9cq/src/endpoint.jl:149 invalidated:
   backedges:  1: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Base.UUID, ::Any) (4 children)
               2: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Module, ::Any) (4 children)
               3: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::REPL.LineEdit.var"#45#76", ::Any) (6 children)
               4: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::REPL.LineEdit.var"#46#77", ::Any) (6 children)
               5: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::REPL.LineEdit.var"#74#105"{REPL.LineEdit.HistoryPrompt}, ::Any) (6 children)
               6: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::REPL.LineEdit.var"#75#106"{REPL.LineEdit.HistoryPrompt}, ::Any) (6 children)
               7: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::REPL.var"#73#83"{REPL.LineEdit.Prompt}, ::Any) (6 children)
               8: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::REPL.var"#75#85"{REPL.LineEdit.Prompt}, ::Any) (6 children)
               9: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::REPL.LineEdit.var"#251#255"{REPL.LineEdit.PrefixHistoryPrompt}, ::Any) (7 children)
              10: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::REPL.LineEdit.var"#252#256"{REPL.LineEdit.PrefixHistoryPrompt}, ::Any) (7 children)
              11: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::typeof(-), ::Any) (9 children)
              12: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::typeof(+), ::Any) (10 children)
              13: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Method, ::Any) (24 children)
              14: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Core.TypeName, ::Any) (69 children)
              15: superseding ==(x, y) in Base at Base.jl:87 with MethodInstance for ==(::Symbol, ::Any) (133 children)

(this is on Intervals 1.5.0)

@omus
Copy link
Collaborator

omus commented Jul 23, 2021

Probably is safe to update these to be:

Base.:(==)(a::T, b::Endpoint::T) where T = a == b.endpoint && isclosed(b)
Base.:(==)(a::Endpoint{T}, b::T) where T = b == a

Not quite as general but probably covers our needs

@matbesancon
Copy link
Author

Got another one:

inserting convert(::Type{T}, interval::Intervals.AnchoredInterval{P, T, L, R} where {L<:Intervals.Bounded, R<:Intervals.Bounded}) where {P, T} in Intervals at /home/mbesancon/.julia/packages/Intervals/ua9cq/src/anchoredinterval.jl:181 invalidated:

this one was huge with 311 invalidated signatures
on current version 1.5.0

@omus
Copy link
Collaborator

omus commented Oct 8, 2021

Got another one:

inserting convert(::Type{T}, interval::Intervals.AnchoredInterval{P, T, L, R} where {L<:Intervals.Bounded, R<:Intervals.Bounded}) where {P, T} in Intervals at /home/mbesancon/.julia/packages/Intervals/ua9cq/src/anchoredinterval.jl:181 invalidated:

Good news. That method is already deprecated:

depwarn(
"`convert(T, interval::AnchoredInterval{P,T})` is deprecated for " *
"intervals which are not closed with coinciding endpoints. " *
"Use `anchor(interval)` instead.",
:convert,
)

@matbesancon
Copy link
Author

perfect!

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

2 participants