@@ -35,6 +35,13 @@ show_index(io::IO, x::LogicalIndex) = summary(io, x.mask)
35
35
show_index (io:: IO , x:: OneTo ) = print (io, " 1:" , x. stop)
36
36
show_index (io:: IO , x:: Colon ) = print (io, ' :' )
37
37
38
+ function showerror (io:: IO , ex:: Meta.ParseError )
39
+ if isnothing (ex. detail)
40
+ print (io, " ParseError(" , repr (ex. msg), " )" )
41
+ else
42
+ showerror (io, ex. detail)
43
+ end
44
+ end
38
45
39
46
function showerror (io:: IO , ex:: BoundsError )
40
47
print (io, " BoundsError" )
@@ -243,7 +250,7 @@ function showerror(io::IO, ex::MethodError)
243
250
ft = typeof (f)
244
251
arg_types_param = arg_types_param[3 : end ]
245
252
kwargs = pairs (ex. args[1 ])
246
- ex = MethodError (f, ex. args[3 : end :: Int ])
253
+ ex = MethodError (f, ex. args[3 : end :: Int ], ex . world )
247
254
end
248
255
name = ft. name. mt. name
249
256
if f === Base. convert && length (arg_types_param) == 2 && ! is_arg_types
@@ -490,7 +497,11 @@ function show_method_candidates(io::IO, ex::MethodError, @nospecialize kwargs=()
490
497
if ! ((min (length (t_i), length (sig)) == 0 ) && k== 1 )
491
498
print (iob, " , " )
492
499
end
493
- if get (io, :color , false ):: Bool
500
+ if k == 1 && Base. isvarargtype (sigtype)
501
+ # There wasn't actually a mismatch - the method match failed for
502
+ # some other reason, e.g. world age. Just print the sigstr.
503
+ print (iob, sigstr... )
504
+ elseif get (io, :color , false ):: Bool
494
505
let sigstr= sigstr
495
506
Base. with_output_color (Base. error_color (), iob) do iob
496
507
print (iob, " ::" , sigstr... )
0 commit comments