www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13943] New: Grammar does not list 'super' and 'this' as types

https://issues.dlang.org/show_bug.cgi?id=13943

          Issue ID: 13943
           Summary: Grammar does not list 'super' and 'this' as types
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/grammar.html#AliasDeclaration
                OS: All
            Status: NEW
          Keywords: spec
          Severity: normal
          Priority: P1
         Component: websites
          Assignee: nobody puremagic.com
          Reporter: briancschott gmail.com
            Blocks: 10233

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()

--
Jan 05 2015