diff --git a/src/abstractinterpret/inferenceerrorreport.jl b/src/abstractinterpret/inferenceerrorreport.jl index ef05e09ce..5fb886dc6 100644 --- a/src/abstractinterpret/inferenceerrorreport.jl +++ b/src/abstractinterpret/inferenceerrorreport.jl @@ -335,8 +335,10 @@ function (T::Type{<:InferenceErrorReport})(state, @nospecialize(spec_args...)) return T([vf], vf.sig, spec_args...) end -get_spec_args(T::Type{<:InferenceErrorReport}) = error(lazy"`get_spec_args` is not implemented for $T") -print_report(io::IO, report::InferenceErrorReport) = error(lazy"`print_report` is not implemented for $(typeof(report))") +get_spec_args(report::InferenceErrorReport) = (@nospecialize; + error(lazy"`get_spec_args(::$(typeof(report)))` is not implemented")) +print_report(io::IO, report::InferenceErrorReport) = (@nospecialize; + error(lazy"`print_report(::IO, ::$(typeof(report)))` is not implemented")) # default error report printer function default_report_printer(io::IO, msg::AbstractString, sig::Signature) diff --git a/src/analyzers/jetanalyzer.jl b/src/analyzers/jetanalyzer.jl index 8bb129fa0..0157f1cfe 100644 --- a/src/analyzers/jetanalyzer.jl +++ b/src/analyzers/jetanalyzer.jl @@ -812,7 +812,7 @@ end @reportdef struct DivideErrorReport <: BuiltinErrorReport end let msg = sprint(showerror, DivideError()) - function print_report(io::IO, ::DivideErrorReport) + global function print_report(io::IO, ::DivideErrorReport) print_error(io, msg) end end