[Issue 23371] New: Error Message For Using Non-static members Statically Could Be Better

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 24 16:52:53 UTC 2022


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

          Issue ID: 23371
           Summary: Error Message For Using Non-static members Statically
                    Could Be Better
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: jack at jackstouffer.com

struct Foo
{
    int a;
}

void main()
{
    Foo.a;
}

Gives the error

    onlineapp.d(8): Error: need `this` for `a` of type `int`

If possible, I'd like something like this

    onlineapp.d(8): Error: `a` of type `Foo` is not a static member and needs a
`this` pointer

--


More information about the Digitalmars-d-bugs mailing list