[Issue 21852] New: diagnostic: One-liner errors with formatted Loc should print context when -verrors=context

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 23 11:06:50 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=21852

          Issue ID: 21852
           Summary: diagnostic: One-liner errors with formatted Loc should
                    print context when -verrors=context
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org

For example:
---
char skip()
{
    goto Lskip;
    char ch = '!';
Lskip:
    return ch;
}
---

Reports:
---
mod.d(3): Error: goto skips declaration of variable mod.skip.ch at mod.d(4)
    goto Lskip;
    ^
---

Whereas a better error that takes advantage of `-verrors=context' would be:
---
mod.d(3): Error: `goto` skips declaration of variable `mod.skip.ch`
    goto Lskip;
    ^
mod.d(4):        declared here
    char ch = '!';
         ^
---

--


More information about the Digitalmars-d-bugs mailing list