[Issue 1356] New: Some parsing issues with struct initializers.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 20 13:39:15 PDT 2007


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

           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 at digitalmars.com
        ReportedBy: aziz.kerim at 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 = {


-- 



More information about the Digitalmars-d-bugs mailing list