Skip to content

Commit

Permalink
Print type signature for what was inferring whenever an internal erro…
Browse files Browse the repository at this point in the history
…r is thrown (JuliaLang#52695)
  • Loading branch information
oxinabox authored Jan 4, 2024
1 parent 0f6c72c commit f9b27b3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,15 @@ jl_code_info_t *jl_type_infer(jl_method_instance_t *mi, size_t world, int force)
}
JL_CATCH {
jl_value_t *e = jl_current_exception();
jl_printf((JL_STREAM*)STDERR_FILENO, "Internal error: during type inference of\n");
jl_static_show_func_sig((JL_STREAM*)STDERR_FILENO, (jl_value_t*)mi->specTypes);
jl_printf((JL_STREAM*)STDERR_FILENO, "\nEncountered ");
if (e == jl_stackovf_exception) {
jl_printf((JL_STREAM*)STDERR_FILENO, "Internal error: stack overflow in type inference of ");
jl_static_show_func_sig((JL_STREAM*)STDERR_FILENO, (jl_value_t*)mi->specTypes);
jl_printf((JL_STREAM*)STDERR_FILENO, ".\n");
jl_printf((JL_STREAM*)STDERR_FILENO, "stack overflow.\n");
jl_printf((JL_STREAM*)STDERR_FILENO, "This might be caused by recursion over very long tuples or argument lists.\n");
}
else {
jl_printf((JL_STREAM*)STDERR_FILENO, "Internal error: encountered unexpected error in runtime:\n");
jl_printf((JL_STREAM*)STDERR_FILENO, "unexpected error in runtime:\n");
jl_static_show((JL_STREAM*)STDERR_FILENO, e);
jl_printf((JL_STREAM*)STDERR_FILENO, "\n");
jlbacktrace(); // written to STDERR_FILENO
Expand Down

0 comments on commit f9b27b3

Please sign in to comment.