You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Turn on debug and try the following on e.g. bbf3dfa
julia> a(x::T) where T<:Integer = 1a (generic function with 1 method)julia> is_stable_function(a)┌ Debug: is_stable_function: a└ @ StabilityCheck ~/research/julia-type-stability/sts/repo/src/StabilityCheck.jl:191┌ Debug: is_stable_method: a(x::T) where T<:Integer in Main at REPL[6]:1└ @ StabilityCheck ~/research/julia-type-stability/sts/repo/src/StabilityCheck.jl:201┌ Debug: all_subtypes: Any[T<:Integer]└ @ StabilityCheck ~/research/julia-type-stability/sts/repo/src/StabilityCheck.jl:396┌ Debug: all_subtypes loop: Any[T<:Integer]└ @ StabilityCheck ~/research/julia-type-stability/sts/repo/src/StabilityCheck.jl:401┌ Debug: all_subtypes: concrete!└ @ StabilityCheck ~/research/julia-type-stability/sts/repo/src/StabilityCheck.jl:4041-element Vector{MethStCheck}: MethStCheck(a(x::T) where T<:Integer in Main at REPL[6]:1, Stb(1))
Notice how we go over a free type variable (all_subtypes loop: Any[T<:Integer]). This happens to give the right answer in this case but it's a
pure coincidence.
In more complicated cases we fail. E.g. the Flux package:
I looked into it again and it's painful to implement (in the current arch but also generally, I think). It looks like at the very top level of is_stable_method we need to start instantiating type variables of a generic method before doing a single thing (e.g. before splitting the method into a function object and a signature), So, in a nutshell, you rename the current is_stable_method to is_stable_method_mono and call it from the new is_stable_method that does the instantiation.
Turn on debug and try the following on e.g. bbf3dfa
Notice how we go over a free type variable (
all_subtypes loop: Any[T<:Integer]
). This happens to give the right answer in this case but it's apure coincidence.
In more complicated cases we fail. E.g. the Flux package:
How To Fix
First thought: skip (but count) generic methods altogether. Otherwise, perhaps,
the binder could be preserved.
The text was updated successfully, but these errors were encountered: