Bug 13326 – Specification of CaseStatement doesn't fit empty case body

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-08-18T20:15:08Z
Last change time
2019-12-21T13:20:30Z
Keywords
spec, trivial
Assigned to
No Owner
Creator
s.trump
Blocks
10233

Comments

Comment #0 by s.trump — 2014-08-18T20:15:08Z
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.
Comment #1 by bugzilla — 2019-12-21T13:20:30Z
*** This issue has been marked as a duplicate of issue 9529 ***