Skip to content

Commit

Permalink
improve error message for invoke
Browse files Browse the repository at this point in the history
This is effectively a type-assert, but the error message sounded
confusing and internal without the context of what it got and what it
expected to get.

Refs: #51826
  • Loading branch information
vtjnash committed Oct 23, 2023
1 parent 0be0b38 commit 2d7692a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ JL_CALLABLE(jl_f_invoke)
if (!jl_is_tuple_type(jl_unwrap_unionall(args[1])))
jl_type_error("invoke", (jl_value_t*)jl_anytuple_type_type, args[1]);
if (!jl_tuple_isa(&args[2], nargs - 2, (jl_datatype_t*)argtypes))
jl_error("invoke: argument type error");
jl_type_error("invoke: argument type error", argtypes, jl_f_tuple(NULL, &args[2], nargs - 2));
jl_value_t *res = jl_gf_invoke(argtypes, args[0], &args[2], nargs - 1);
JL_GC_POP();
return res;
Expand Down

0 comments on commit 2d7692a

Please sign in to comment.