[Issue 1356] Some parsing issues with struct initializers.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 22 00:59:59 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=1356


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug at yahoo.com.au
         Resolution|                            |FIXED


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2011-12-22 00:59:59 PST ---
(In reply to comment #0)
> struct foo { int a = 4; }
> 
> static foo f = {a:void,}; // Void initializer allowed in struct initializer.
> writefln(f.a); // prints 0

This isn't a bug.

> 
> // Struct initializer can have any number of leading and trailing commas,
> whereas only a trailing one is allowed.
> static foo f = {,,,,a:1,,,,};

Fixed in 2.055 and 1.070.

> 
> // Compiler hangs if this is at the end of a file.
> static foo f = {

Fixed in 1.023.

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


More information about the Digitalmars-d-bugs mailing list