Thread overview
[Issue 7183] Bad error message when trying to use this in a static member function of a struct
Apr 28, 2014
Andrej Mitrovic
Dec 17, 2022
Iain Buclaw
April 28, 2014
https://issues.dlang.org/show_bug.cgi?id=7183

Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich@gmail.com
            Version|unspecified                 |D2

--- Comment #2 from Andrej Mitrovic <andrej.mitrovich@gmail.com> ---
Unfortunately both examples now emit the less informative diagnostic:

-----
struct S
{
    int x;
    static void f() { x = 1; }
}

class C
{
    int x;
    static void f() { x = 1; }
}

void main() { }
-----

test.d(4): Error: need 'this' for 'x' of type 'int'
test.d(10): Error: need 'this' for 'x' of type 'int'

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=7183

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P3

--
December 13
https://issues.dlang.org/show_bug.cgi?id=7183

--- Comment #3 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18392

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--