[Issue 7126] New: struct constructor ignored with global initializers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Dec 17 12:58:31 PST 2011


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

           Summary: struct constructor ignored with global initializers
           Product: D
           Version: D2
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: siegelords_abode at yahoo.com


--- Comment #0 from siegelords_abode at yahoo.com 2011-12-17 12:58:30 PST ---
struct new_int
{
    this(int val)
    {
        payload = val;
    }
    int payload = -1;
    alias payload this;
}

new_int a = 1; // Error: cannot implicitly convert expression (1) of type int
to new_int

void main()
{
    new_int b = 1; // Works ok
}

-- 
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