Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message for generic subtyping. #4517

Merged
merged 2 commits into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/libponyc/type/subtype.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,11 @@ static bool is_eq_typeargs(ast_t* a, ast_t* b, errorframe_t* errorf,

if(!ret && errorf != NULL)
{
ast_error_frame(errorf, a, "%s has different type arguments than %s",
ast_error_frame(errorf, a,
"%s has different type arguments than %s (the type arguments must be equivalent, not covariant nor contravariant)",
ast_print_type(a), ast_print_type(b));
ast_error_frame(errorf, a,
"this might be possible if either %s or %s were an interface rather than a concrete type",
ast_print_type(a), ast_print_type(b));
}

Expand Down
Loading