@@ -199,19 +199,20 @@ function print_with_compare(io::IO, @nospecialize(a), @nospecialize(b), color::S
199
199
end
200
200
end
201
201
202
- function show_convert_error (io:: IO , ex:: MethodError , @nospecialize ( arg_types_param) )
202
+ function show_convert_error (io:: IO , ex:: MethodError , arg_types_param)
203
203
# See #13033
204
204
T = striptype (ex. args[1 ])
205
205
if T === nothing
206
206
print (io, " First argument to `convert` must be a Type, got " , ex. args[1 ])
207
207
else
208
- print_one_line = isa (T, DataType) && isa (arg_types_param[2 ], DataType) && T. name != arg_types_param[2 ]. name
208
+ p2 = arg_types_param[2 ]
209
+ print_one_line = isa (T, DataType) && isa (p2, DataType) && T. name != p2. name
209
210
printstyled (io, " Cannot `convert` an object of type " )
210
211
print_one_line || printstyled (io, " \n " )
211
- print_with_compare (io, arg_types_param[ 2 ] , T, :light_green )
212
+ print_with_compare (io, p2 , T, :light_green )
212
213
printstyled (io, " to an object of type " )
213
214
print_one_line || printstyled (io, " \n " )
214
- print_with_compare (io, T, arg_types_param[ 2 ] , :light_red )
215
+ print_with_compare (io, T, p2 , :light_red )
215
216
end
216
217
end
217
218
0 commit comments