Bug 4134 – Trailing comma allowed in parameter lists

Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
Other
OS
Linux
Creation time
2010-04-29T09:32:00Z
Last change time
2014-02-15T02:18:56Z
Keywords
accepts-invalid
Assigned to
nobody
Creator
aziz.koeksal

Comments

Comment #0 by aziz.koeksal — 2010-04-29T09:32:56Z
Example: void main(char[][] args,) {}
Comment #1 by ellery-newcomer — 2010-04-29T11:20:25Z
Sweet. How long has this feature been available?
Comment #2 by simen.kjaras — 2010-04-30T03:43:48Z
This is allowed for simplicity with generated code, I believe. Makes it a bit easier to generate parameter lists, enumeration enums (darn those other enums), etc. It's been around for as long as I can remember, and hopefully won't ever be 'fixed'.
Comment #3 by aziz.koeksal — 2010-04-30T05:50:36Z
(In reply to comment #2) > This is allowed for simplicity with generated code, I believe. Makes it a bit > easier to generate parameter lists, enumeration enums (darn those other enums), > etc. > This would make more sense for array literals, because generating them should happen much more often than generating parameter lists. I have no problem with trailing commas, but it's not consistently allowed everywhere.
Comment #4 by clugdbug — 2010-04-30T05:55:50Z
(In reply to comment #3) > (In reply to comment #2) > > This is allowed for simplicity with generated code, I believe. Makes it a bit > > easier to generate parameter lists, enumeration enums (darn those other enums), > > etc. > > > > This would make more sense for array literals, because generating them should > happen much more often than generating parameter lists. > > I have no problem with trailing commas, but it's not consistently allowed > everywhere. See bug 2477.