@@ -268,20 +268,24 @@ function showerror(io::IO, ex::MethodError)
268268 f_is_function = true
269269 end
270270 print (io, " no method matching " )
271- show_signature_function (io, isa (f, Type) ? Type{f} : typeof (f))
272- print (io, " (" )
271+ iob = IOContext (IOBuffer (), io) # for type abbreviation as in #49795; some, like `convert(T, x)`, should not abbreviate
272+ show_signature_function (iob, isa (f, Type) ? Type{f} : typeof (f))
273+ print (iob, " (" )
273274 for (i, typ) in enumerate (arg_types_param)
274- print (io , " ::" , typ)
275- i == length (arg_types_param) || print (io , " , " )
275+ print (iob , " ::" , typ)
276+ i == length (arg_types_param) || print (iob , " , " )
276277 end
277278 if ! isempty (kwargs)
278- print (io , " ; " )
279+ print (iob , " ; " )
279280 for (i, (k, v)) in enumerate (kwargs)
280- print (io , k, " ::" , typeof (v))
281- i == length (kwargs):: Int || print (io , " , " )
281+ print (iob , k, " ::" , typeof (v))
282+ i == length (kwargs):: Int || print (iob , " , " )
282283 end
283284 end
284- print (io, " )" )
285+ print (iob, " )" )
286+ str = String (take! (unwrapcontext (iob)[1 ]))
287+ str = type_limited_string_from_context (io, str)
288+ print (io, str)
285289 end
286290 # catch the two common cases of element-wise addition and subtraction
287291 if (f === Base.:+ || f === Base.:- ) && length (arg_types_param) == 2
0 commit comments