Thread overview
[Issue 13130] Syntax check fails when this is used as argument type
Jul 18, 2014
Rainer Schuetze
Jul 24, 2014
Benjamin Thaut
Aug 23, 2014
Rainer Schuetze
Aug 23, 2014
Rainer Schuetze
May 12, 2018
Nick Treleaven
May 12, 2018
Mike Franklin
July 18, 2014
https://issues.dlang.org/show_bug.cgi?id=13130

Rainer Schuetze <r.sagitario@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.sagitario@gmx.de

--- Comment #1 from Rainer Schuetze <r.sagitario@gmx.de> ---
I remember having seen this syntax before, but do you have a link to it being mentioned in the language spec? I have found postblit only, but that does not come with an identifier.

I guess you are using DParser as the semantic engine (though probably the other engine doesn't accept it, too).

--
July 19, 2014
https://issues.dlang.org/show_bug.cgi?id=13130

hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh@quickfur.ath.cx

--- Comment #2 from hsteoh@quickfur.ath.cx ---
Shouldn't that be:

this(typeof(this) other) { ... }

? Is this a case of accepts-invalid?

--
July 24, 2014
https://issues.dlang.org/show_bug.cgi?id=13130

--- Comment #3 from Benjamin Thaut <code@benjamin-thaut.de> ---
I did actually read about this syntax on the newsgroup. I don't remember where, but after I read about it I tried it out and it works flawlessly. And it is so much shorter to write and looks a lot nicer in then "typeof(this)". I don't think this is a accepts invalid, because according to the newsgroup this is by design, although I don't know if it is mentioned in the spec.

--
August 23, 2014
https://issues.dlang.org/show_bug.cgi?id=13130

--- Comment #4 from Rainer Schuetze <r.sagitario@gmx.de> ---
I also think this is a misfeature. Some experiments show that is very inconsistent: the following code compiles, commented lines throw an error.

class Foo
{
    this(this that, super base)
    {
        // this other = that;
        // static shared(super) s;
    }
    void member(this that)
    {
    }
    super base;
    // this next;
    shared(this) that;
    static shared(super) sup;
}

Similar stuff works for structs an "this", "super" is an undefined identifier.

--
August 23, 2014
https://issues.dlang.org/show_bug.cgi?id=13130

--- Comment #5 from Rainer Schuetze <r.sagitario@gmx.de> ---
related: issue 12228, also specifying the introducing commit.

--
May 12, 2018
https://issues.dlang.org/show_bug.cgi?id=13130

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |nick@geany.org
         Resolution|---                         |WONTFIX

--- Comment #6 from Nick Treleaven <nick@geany.org> ---
>   this(this other)

Issue 18228 has been fixed, deprecating this syntax - closing this. Outside a parameter list, Rainer's issue is still open.

--
May 12, 2018
https://issues.dlang.org/show_bug.cgi?id=13130

Mike Franklin <slavo5150@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |slavo5150@yahoo.com
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=12228

--