www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13979] New: ForeachType grammar does not allow 'ref' to


          Issue ID: 13979
           Summary: ForeachType grammar does not allow 'ref' to appear
                    after type constructors
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/grammar.html#ForeachType
                OS: All
            Status: NEW
          Keywords: spec
          Severity: normal
          Priority: P1
         Component: websites
          Assignee: nobody puremagic.com
          Reporter: briancschott gmail.com
            Blocks: 10233

Example DMD-valid code rejected by language spec:
foreach (foo, const ref bar; qwer.tyuiop)

The grammar spec says this:

    'ref'? TypeCtors? BasicType Declarator
    'ref'? TypeCtors? Identifier

Either the compiler should be changed to require that 'ref' appear first, or
the grammar should be corrected to allow 'ref' to appear after type

Jan 13 2015