[Issue 13326] New: Specification of CaseStatement doesn't fit empty case body

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Aug 18 13:15:08 PDT 2014


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

          Issue ID: 13326
           Summary: Specification of CaseStatement doesn't fit empty case
                    body
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: spec
          Severity: normal
          Priority: P1
         Component: websites
          Assignee: nobody at puremagic.com
          Reporter: s.trump at gmail.com
            Blocks: 10233

Lets parse next D code:

> switch(n) {
> case 1:
> case 2:
>   return true;
> }

This is a valid D language construction. But documentation says that statement
"case 1:" must be followed by any statement except other "case" or "default".
As documentation says (http://dlang.org/statement#CaseStatement)
"case ArgumentList :" is followed by "ScopeStatementList"
(http://dlang.org/statement#ScopeStatementList) which is a list of any
statements except CaseStatement or CaseRangeStatement or DefaultStatement. This
rule conflicts with actual D language compiler.

--


More information about the Digitalmars-d-bugs mailing list