Jump to page: 1 2
Thread overview
[Issue 12228] Identifiers 'this' and 'super' should not be allowed as base classes
Apr 27, 2014
Andrej Mitrovic
Apr 28, 2014
Walter Bright
May 02, 2014
Walter Bright
Aug 23, 2014
Rainer Schuetze
Mar 28, 2015
yebblies
May 12, 2018
Nick Treleaven
May 12, 2018
Mike Franklin
May 13, 2018
Mike Franklin
May 14, 2018
Nick Treleaven
May 14, 2018
Nick Treleaven
May 14, 2018
Nick Treleaven
May 14, 2018
Mike Franklin
Dec 17, 2019
berni44
April 27, 2014
https://issues.dlang.org/show_bug.cgi?id=12228

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
           Assignee|nobody@puremagic.com        |andrej.mitrovich@gmail.com
            Summary|Compiler allows 'this' in   |Identifiers 'this' and
                   |BaseClassList               |'super' should not be
                   |                            |allowed as base classes

--- Comment #3 from Andrej Mitrovic <andrej.mitrovich@gmail.com> ---
https://github.com/D-Programming-Language/dmd/pull/3505

--
April 28, 2014
https://issues.dlang.org/show_bug.cgi?id=12228

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> ---
The Issue 2540 definitely introduced this. Looking back on it, 2540 was probably a bad idea, but I think we're stuck with it. Trying to step on its other effects just seems to complicate things even more. I suggest just leaving this one alone.

--
May 02, 2014
https://issues.dlang.org/show_bug.cgi?id=12228

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|accepts-invalid, pull       |spec
          Component|DMD                         |websites

--- Comment #5 from Walter Bright <bugzilla@digitalmars.com> ---
let's go the documentation route, i.e. simply document the behavior

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

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

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

--- Comment #6 from Rainer Schuetze <r.sagitario@gmx.de> ---
Here are some more examples of what is allowed with "this" and "super":

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;
}

Commented lines produce an error. See also #13130.

Should this be documented, too?

--
March 28, 2015
https://issues.dlang.org/show_bug.cgi?id=12228

--- Comment #7 from yebblies <yebblies@gmail.com> ---
With issue 14348 fixed, all cases from issue 2540 should be replaceable with typeof(this/super).  I think we should seriously consider deprecating and eventually removing this behavior.

eg Warning: Using 'this' as a type is deprecated, use 'typeof(this)' instead

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

Andrei Alexandrescu <andrei@erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrei@erdani.com

--- Comment #8 from Andrei Alexandrescu <andrei@erdani.com> ---
The problem here is that "this" and "super" are either data or type, depending (by odd rules) on the context. Let's make that a deprecation and then an error. Thanks.

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

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=18228

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

Mike Franklin <slavo5150@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=13130

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

Mike Franklin <slavo5150@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
                 CC|                            |slavo5150@yahoo.com

--- Comment #9 from Mike Franklin <slavo5150@yahoo.com> ---
PR: https://github.com/dlang/dmd/pull/8242

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

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick@geany.org

--- Comment #10 from Nick Treleaven <nick@geany.org> ---
It's great that `this` doesn't work as a type in a parameter list now Issue 18228 is fixed, but `super` should probably be disallowed too:

class A
{
    void foo(super i) {}
}

--
« First   ‹ Prev
1 2