May 19, 2023
https://issues.dlang.org/show_bug.cgi?id=23928

          Issue ID: 23928
           Summary: improve error msg: scope variable s assigned to
                    non-scope parameter this calling abc
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: bugzilla@digitalmars.com

The code:

struct S {
    int* p;
    void abc(int i) @safe { }
}

void test() @safe {
    int i;
    S s;
    s.p = &i;
    s.abc(1);
}

compiled with -preview=dip1000 produces the message:

test.d(13): Error: scope variable `s` assigned to non-scope parameter `this`
calling `abc`

A better message would be:

Error: scope variable `s` calling non-scope member function `abc`

--