Bug 13943 – Grammar does not list 'super' and 'this' as types

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-01-06T06:41:55Z
Last change time
2020-03-21T03:56:36Z
Keywords
pull, spec
Assigned to
No Owner
Creator
briancschott
Blocks
10233
See also
https://issues.dlang.org/show_bug.cgi?id=12228

Comments

Comment #0 by briancschott — 2015-01-06T06:41:55Z
Relevant issues: https://issues.dlang.org/show_bug.cgi?id=2540 https://issues.dlang.org/show_bug.cgi?id=12228 DMD accepts 'this' and 'super', but this behavior is undocumented. An example of where this causes problems: --- class A { void send() {} } class B : A { send = super.send; } --- The grammar doesn't allow 'super' to appear in AliasDeclarationX or BasicType, but DMD's parse.c does look for 'super' and 'this' in Parser::parseBasicType()
Comment #1 by nick — 2018-05-14T11:15:49Z
As Issue 9597 has been fixed, it looks like these keywords will no longer be accepted as types - see the recent pull for Issue 12228.
Comment #2 by slavo5150 — 2018-05-14T11:34:05Z