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

Print type signature for what was inferring whenever an error is thrown #52695

Merged
merged 2 commits into from
Jan 4, 2024

Conversation

oxinabox
Copy link
Contributor

@oxinabox oxinabox commented Jan 2, 2024

From discussion on slack with Keno.
When something is going wrong with inference it is always good to know what we were trying to infer.

Example of new output for nonstack-overflow case (what I am dealing with in the wild)

Internal error: during type inference of
(::Diffractor.∂☆recurse{1})(Diffractor.TangentBundle{1, Diffractor.∂☆{1}, Diffractor.UniformTangent{ChainRulesCore.NoTangent}}, Diffractor.TangentBundle{1, Diffractor.TangentBundle{1, typeof(Core.apply_type), Diffractor.UniformTangent{ChainRulesCore.NoTangent}}, Diffractor.TaylorTangent{Tuple{ChainRulesCore.Tangent{Diffractor.TangentBundle{1, typeof(Core.apply_type), Diffractor.UniformTangent{ChainRulesCore.NoTangent}}, NamedTuple{(:primal, :tangent), Tuple{ChainRulesCore.NoTangent, ChainRulesCore.Tangent{Diffractor.UniformTangent{ChainRulesCore.NoTangent}, NamedTuple{(:val,), Tuple{ChainRulesCore.NoTangent}}}}}}}}}, Diffractor.TangentBundle{1, Diffractor.TangentBundle{1, Type{Base.Val{x} where x}, Diffractor.UniformTangent{ChainRulesCore.NoTangent}}, Diffractor.TaylorTangent{Tuple{ChainRulesCore.Tangent{Diffractor.TangentBundle{1, Type{Base.Val{x} where x}, Diffractor.UniformTangent{ChainRulesCore.NoTangent}}, NamedTuple{(:primal, :tangent), Tuple{ChainRulesCore.NoTangent, ChainRulesCore.Tangent{Diffractor.UniformTangent{ChainRulesCore.NoTangent}, NamedTuple{(:val,), Tuple{ChainRulesCore.NoTangent}}}}}}}}}, Diffractor.TangentBundle{1, Diffractor.TangentBundle{1, Int64, Diffractor.TaylorTangent{Tuple{Int64}}}, Diffractor.TaylorTangent{Tuple{ChainRulesCore.Tangent{Diffractor.TangentBundle{1, Int64, Diffractor.TaylorTangent{Tuple{Int64}}}, NamedTuple{(:primal, :tangent), Tuple{Int64, ChainRulesCore.Tangent{Diffractor.TaylorTangent{Tuple{Int64}}, NamedTuple{(:coeffs,), Tuple{ChainRulesCore.Tangent{Tuple{Int64}, Tuple{Int64}}}}}}}}}}})
Encountered unexpected error in runtime:
MethodError(f=Core.Compiler.:(), args=(Core.Compiler.JLTypeLattice(), Vararg{Any}, Symbol), world=0x00000000000016ae)
jl_method_error_bare at /usr/local/src/julia-crimes/src/gf.c:2216
jl_method_error at /usr/local/src/julia-crimes/src/gf.c:2234
jl_lookup_generic_ at /usr/local/src/julia-crimes/src/gf.c:3079 [inlined]
ijl_apply_generic at /usr/local/src/julia-crimes/src/gf.c:3094
 at ./compiler/typelattice.jl:530
 at ./compiler/typelattice.jl:508
 at ./compiler/typelattice.jl:432 [inlined]
 at ./compiler/typelattice.jl:397
#366 at ./compiler/abstractlattice.jl:288 [inlined]
typevar_nothrow at ./compiler/tfuncs.jl:613 [inlined]
_builtin_nothrow at ./compiler/tfuncs.jl:2180
builtin_nothrow at ./compiler/tfuncs.jl:2605 [inlined]
builtin_effects at ./compiler/tfuncs.jl:2523
abstract_call_known at ./compiler/abstractinterpretation.jl:2122
abstract_call at ./compiler/abstractinterpretation.jl:2250
abstract_apply at ./compiler/abstractinterpretation.jl:1664
abstract_call_known at ./compiler/abstractinterpretation.jl:2076
abstract_call at ./compiler/abstractinterpretation.jl:2250
abstract_call at ./compiler/abstractinterpretation.jl:2243
abstract_call at ./compiler/abstractinterpretation.jl:2401
abstract_eval_call at ./compiler/abstractinterpretation.jl:2416
...

@Keno
Copy link
Member

Keno commented Jan 2, 2024

FWIW, your actual error looks like #52613

@aviatesk aviatesk added the merge me PR is reviewed. Merge when all tests are passing label Jan 4, 2024
@maleadt maleadt merged commit f9b27b3 into JuliaLang:master Jan 4, 2024
3 checks passed
@oscardssmith oscardssmith removed the merge me PR is reviewed. Merge when all tests are passing label Jan 4, 2024
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

Successfully merging this pull request may close these issues.

5 participants