[Issue 7191] New: ctor/opAssign doesn't play nice with field	initialization
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Sat Dec 31 09:50:41 PST 2011
    
    
  
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: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com
--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at 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: -------
    
    
More information about the Digitalmars-d-bugs
mailing list