@@ -268,20 +268,24 @@ function showerror(io::IO, ex::MethodError)
268
268
f_is_function = true
269
269
end
270
270
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, " (" )
273
274
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 , " , " )
276
277
end
277
278
if ! isempty (kwargs)
278
- print (io , " ; " )
279
+ print (iob , " ; " )
279
280
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 , " , " )
282
283
end
283
284
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)
285
289
end
286
290
# catch the two common cases of element-wise addition and subtraction
287
291
if (f === Base.:+ || f === Base.:- ) && length (arg_types_param) == 2
0 commit comments