diff --git a/Compiler/src/Compiler.jl b/Compiler/src/Compiler.jl index 55293277d7f64..2fa785fef0649 100644 --- a/Compiler/src/Compiler.jl +++ b/Compiler/src/Compiler.jl @@ -140,7 +140,7 @@ baremodule BuildSettings using Core: ARGS, include, Int, === using ..Compiler: >, getindex, length -global MAX_METHODS::Int = 3 +global MAX_METHODS::Int = 1 if length(ARGS) > 2 && ARGS[2] === "--buildsettings" include(BuildSettings, ARGS[3]) diff --git a/Compiler/src/abstractinterpretation.jl b/Compiler/src/abstractinterpretation.jl index 1728965e3702c..f103d8c398b5f 100644 --- a/Compiler/src/abstractinterpretation.jl +++ b/Compiler/src/abstractinterpretation.jl @@ -122,6 +122,12 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(fun return Future(CallMeta(Any, Any, Effects(), NoCallInfo())) end + # Disable inference when not fully covered (similar to union split limit) + if !fully_covering(matches) + add_remark!(interp, sv, "Inference disabled for method without full coverage") + return Future(CallMeta(Any, Any, Effects(), NoCallInfo())) + end + (; valid_worlds, applicable) = matches update_valid_age!(sv, get_inference_world(interp), valid_worlds) # need to record the negative world now, since even if we don't generate any useful information, inlining might want to add an invoke edge and it won't have this information anymore if bail_out_toplevel_call(interp, sv)