www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2651] New: class body declaration grammar incorrect

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2651

           Summary: class body declaration grammar incorrect
           Product: D
           Version: 2.023
          Platform: PC
               URL: http://www.digitalmars.com/d/2.0/class.html
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: www.digitalmars.com
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: jlquinn optonline.net


The published class grammar looks like:

ClassBodyDeclaration:
        Declaration
        Constructor
        Destructor
        StaticConstructor
        StaticDestructor
        Invariant
        UnitTest
        ClassAllocator
        ClassDeallocator

However, the Declaration grammar doesn't permit a construct such as

synchronized ~this () {}

  or

const {
  void fn1 () {}
  void fn2 () {}
}

The rest of the docs clearly expect this kind of construction to be allowed.  I
believe the fix is to modify the class body grammar to:

ClassBodyDeclaration:
        DeclDef               <-- this is the change
        Constructor
        Destructor
        StaticConstructor
        StaticDestructor
        Invariant
        UnitTest
        ClassAllocator
        ClassDeallocator


-- 
Feb 08 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2651


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



08:30:45 PST ---
http://www.dsource.org/projects/phobos/changeset/2135

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 08 2010