@@ -259,7 +259,7 @@ function showerror(io::IO, ex::MethodError)
259
259
is_arg_types = ! isa (ex. args, Tuple)
260
260
arg_types = is_arg_types ? ex. args : typesof (ex. args... )
261
261
arg_types_param:: SimpleVector = (unwrap_unionall (arg_types):: DataType ). parameters
262
- san_arg_types_param = Any[rewrap_unionall (a , arg_types) for a in arg_types_param]
262
+ san_arg_types_param = Any[rewrap_unionall (arg_types_param[i] , arg_types) for i in 1 : length ( arg_types_param) ]
263
263
f = ex. f
264
264
meth = methods_including_ambiguous (f, arg_types)
265
265
if isa (meth, MethodList) && length (meth) > 1
@@ -423,10 +423,10 @@ function showerror_ambiguous(io::IO, meths, f, args::Type)
423
423
sigfix = typeintersect (m. sig, sigfix)
424
424
end
425
425
if isa (unwrap_unionall (sigfix), DataType) && sigfix <: Tuple
426
- let sigfix= sigfix
427
- if all (m-> morespecific (sigfix, m. sig), meths)
426
+ let sigfix= Core . Box ( sigfix)
427
+ if all (m-> morespecific (sigfix. contents , m. sig), meths)
428
428
print (io, " \n Possible fix, define\n " )
429
- show_tuple_as_call (io, :function , sigfix)
429
+ show_tuple_as_call (io, :function , sigfix. contents )
430
430
else
431
431
print (io, " To resolve the ambiguity, try making one of the methods more specific, or " )
432
432
print (io, " adding a new method more specific than any of the existing applicable methods." )
@@ -511,10 +511,10 @@ function show_method_candidates(io::IO, ex::MethodError, kwargs=[])
511
511
# If isvarargtype then it checks whether the rest of the input arguments matches
512
512
# the varargtype
513
513
if Base. isvarargtype (sig[i])
514
- sigstr = (unwrapva (unwrap_unionall (sig[i])), " ..." )
514
+ sigstr = Core . svec (unwrapva (unwrap_unionall (sig[i])), " ..." )
515
515
j = length (t_i)
516
516
else
517
- sigstr = (sig[i],)
517
+ sigstr = Core . svec (sig[i],)
518
518
j = i
519
519
end
520
520
# Checks if the type of arg 1:i of the input intersects with the current method
@@ -560,9 +560,9 @@ function show_method_candidates(io::IO, ex::MethodError, kwargs=[])
560
560
for (k, sigtype) in enumerate (sig[length (t_i)+ 1 : end ])
561
561
sigtype = isvarargtype (sigtype) ? unwrap_unionall (sigtype) : sigtype
562
562
if Base. isvarargtype (sigtype)
563
- sigstr = (unwrapva (sigtype:: Core.TypeofVararg ), " ..." )
563
+ sigstr = Core . svec (unwrapva (sigtype:: Core.TypeofVararg ), " ..." )
564
564
else
565
- sigstr = (sigtype,)
565
+ sigstr = Core . svec (sigtype,)
566
566
end
567
567
if ! ((min (length (t_i), length (sig)) == 0 ) && k== 1 )
568
568
print (iob, " , " )
0 commit comments