prl-julia / julia-type-stability

10 stars 0 forks source link

Not enough try-catch in the pipeline #8

Closed ulysses4ever closed 3 years ago

ulysses4ever commented 3 years ago

It seems that when type inference (used in is_stable_call) sometimes fails for some reason. More try-catch!

[ Info: [Stability] About to start analysis
WARNING: CategoricalArrays.CatValue is deprecated, use Union{CategoricalValue{<:Any, R}, CategoricalValue{String, R}} where R instead.
  likely near none:23
WARNING: CategoricalArrays.CategoricalString is deprecated, use CategoricalValue{String, R} where R instead.
  likely near none:23
ERROR: cannot call @generated function `*(a0::Unitful.Dimensions, a::Unitful.Dimensions...) in Unitful at /home/artem/.julia/packages/Unitful/1t88N/src/dimensions.jl:25` with abstract argument types: Tuple{Unitful.Dimensions{(Unitful.Dimension{:Length}(-2//1), Unitful.Dimension{:Time}(1//1))},Unitful.Dimensions}
Stacktrace:
 [1] error(::String, ::Method, ::String, ::String, ::Type{T} where T) at ./error.jl:42
 [2] func_for_method_checked(::Method, ::Any, ::Core.SimpleVector) at ./reflection.jl:1081
 [3] code_typed(::Any, ::Any; optimize::Bool, debuginfo::Symbol, world::UInt64, params::Core.Compiler.Params) at ./reflection.jl:1116
 [4] is_stable_call(::Any, ::Any) at /home/artem/stability/repo/Stability/src/Stability.jl:47
 [5] is_stable_instance(::Core.MethodInstance) at /home/artem/stability/repo/Stability/src/Stability.jl:88
 [6] module_stats(::Module) at /home/artem/stability/repo/Stability/src/Stability.jl:144
 [7] top-level scope at none:23
Error when running tests for package Gadfly
ulysses4ever commented 3 years ago

We should check if the approach works for @generated functions.

ulysses4ever commented 3 years ago

Generic mitigation for this kind of issue (failure in @code_typed) is in 709bbee.

ulysses4ever commented 3 years ago

We do have enough of try-catch inside module_stats as of 1b5263f3b6. The problem with @generated functions will be discussed on a separate issue.