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: [email protected]
          Reporter: [email protected]

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

--

Reply via email to