carbon-lang
carbon-lang copied to clipboard
MissingGenericFunctionDefinition sorted poorly in test output
Description of the bug:
The MissingGenericFunctionDefinition error ends up being attached to test output far below where it is emitted if there are other errors below. It seems to always get sorted to last for some reason?
@zygoloid suggests we may want a custom sort key for the diagnostic.
fn C[T:! type](t: T);
fn F() {
C({});
// CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE+4]]:3: error: name `a` not found [NameNotFound]
// CHECK:STDERR: a;
// CHECK:STDERR: ^
// CHECK:STDERR:
a;
// CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE+11]]:3: error: name `b` not found [NameNotFound]
// CHECK:STDERR: b;
// CHECK:STDERR: ^
// CHECK:STDERR:
// CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE-11]]:3: error: use of undefined generic function [MissingGenericFunctionDefinition]
// CHECK:STDERR: C({});
// CHECK:STDERR: ^
// CHECK:STDERR: fail_impl_cycle_one_generic_param.carbon:[[@LINE-17]]:1: note: generic function declared here [MissingGenericFunctionDefinitionHere]
// CHECK:STDERR: fn C[T:! type](t: T);
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
b;
}
Filing this bug because I don't intend to work on this right now - if anyone wants to pick it up just assign it.
This is because these issues are checked as part of CheckRequiredDefinitions. They would need to be given more specific last nodes in their diagnostic locations. As a reminder, this is a consequence of #4778.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please comment or remove the inactive label. The long term issue label can also be added for issues which are expected to take time.
This issue is labeled inactive because the last activity was over 90 days ago.