www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7061] New: delegates sometimes cannot be used in struct initializers

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

           Summary: delegates sometimes cannot be used in struct
                    initializers
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: timon.gehr gmx.ch



S a = {{}};              // fail
S b = {{;}};             // fail
S c = {{x=0;}};          // fail
T d = {{return 0;}};     // fail

void main(){
    S x = {{}};          // ok
    S y = {{;}};         // fail
    S z = {{x=0;}};      // fail
    T w = {{return 0;}}; // fail
}

The program should compile. The inconsistency between x and y suggests that the
issue is partly related to the parser.

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