www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11162] New: Cannot use implicit ctor call with enum members

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

           Summary: Cannot use implicit ctor call with enum members
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-10-03
05:45:54 PDT ---
-----
struct S
{
    this(int) { }
}

void main()
{
    S s = 0;  // ok

    enum E : S
    {
        a = 0,  // fail
    }
}
-----

$ dmd test.d
test.d(12): Error: cannot implicitly convert expression (0) of type int to S

This might be a dupe report, but I couldn't find an equivalent.

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