Bug 23466 – -verrors=context should not repeat same context for supplemental messages

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2022-11-06T16:56:45Z
Last change time
2022-11-06T22:44:52Z
Keywords
diagnostic, pull
Assigned to
No Owner
Creator
Nick Treleaven

Comments

Comment #0 by nick — 2022-11-06T16:56:45Z
Supplemental messages generally have no need to show the source line context. Below, only the `Error:` lines actually benefit from context: compiler\test\fail_compilation\diag8101.d:57: Error: function `diag8101.f_0(int)` is not callable using argument types `()` f_0(); ^ compiler\test\fail_compilation\diag8101.d:57: too few arguments, expected `1`, got `0` f_0(); ^ compiler\test\fail_compilation\diag8101.d:58: Error: none of the overloads of `f_1` are callable using argument types `()` f_1(); ^ compiler\test\fail_compilation\diag8101.d:33: Candidates are: `diag8101.f_1(int)` void f_1(int); ^ compiler\test\fail_compilation\diag8101.d:34: `diag8101.f_1(int, int)` void f_1(int, int); ^ compiler\test\fail_compilation\diag8101.d:59: Error: none of the overloads of `f_2` are callable using argument types `()` f_2(); ^ PR incoming.
Comment #1 by dlang-bot — 2022-11-06T16:59:15Z
@ntrel created dlang/dmd pull request #14626 "Fix Issue 23466 - -verrors=context should not apply to supplemental m…" fixing this issue: - Fix Issue 23466 - -verrors=context should not apply to supplemental messages https://github.com/dlang/dmd/pull/14626
Comment #2 by nick — 2022-11-06T17:51:01Z
> Supplemental messages generally have no need to show the source line context The ones quoted are not useful. There are some that are arguably useful because they show return type and template constraint where the candidate message doesn't: fail_compilation/constraints_func4.d(91): Error: none of the overloads of template `imports.constraints.overload` are callable using argument types `!()(int, string)` overload(0, ""); ^ fail_compilation/imports/constraints.d(39): Candidates are: `overload(T)(T v)` void overload(T)(T v) if (N!T); ^ So the pull now only hides context for supplemental messages that have the same context as the previous message.
Comment #3 by dlang-bot — 2022-11-06T22:44:52Z
dlang/dmd pull request #14626 "Fix Issue 23466 - -verrors=context should not repeat same context for supplemental m…" was merged into master: - 2ef9260e901897ab46730f9ca0010e5a124480d3 by Nick Treleaven: Fix Issue 23466 - -verrors=context should not apply to supplemental messages https://github.com/dlang/dmd/pull/14626