www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1356] New: Some parsing issues with struct initializers.


           Summary: Some parsing issues with struct initializers.
           Product: D
           Version: 1.017
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: aziz.kerim gmail.com

struct foo { int a = 4; }

static foo f = {a:void,}; // Void initializer allowed in struct initializer.
writefln(f.a); // prints 0

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

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

Jul 20 2007