[Issue 11739] New: Cannot initialize const member declared void

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Dec 14 06:41:21 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11739

           Summary: Cannot initialize const member declared void
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: monarchdodra at gmail.com


--- Comment #0 from monarchdodra at gmail.com 2013-12-14 06:41:19 PST ---
//----
struct S
{
    const(int) i = void;
    this(int j)
    {    
        i = j; 
    }    
}
//----
Error: cannot modify const expression i
//----
The error goes away if we remove the "void". It seems to me like a "hole" in
the const member initialization feature of D?

See also (may be duplicate of):
https://d.puremagic.com/issues/show_bug.cgi?id=10643

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


More information about the Digitalmars-d-bugs mailing list