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

           Summary: ctor/opAssign doesn't play nice with field
                    initialization
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2011-12-31 
09:50:39 PST ---
struct PointF {
    float x, y;
}

struct Point { 
    int x, y;
    this(PointF) { }
    void opAssign(PointF) { }    
}

struct Line {
    Point pt1;
    Point pt2;
}

void main() {
    Line line;
    line.pt1 = PointF(0, 0);  // ok
    line.pt2 = PointF(0, 0);  // ok

    auto line2 = Line(PointF(0, 0), PointF(0, 0));  // ng
}

I see no reason why field initialization shouldn't work if each field defines a
ctor or opAssign that can take such a type.

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

Reply via email to