[Issue 7191] ctor/opAssign doesn't play nice with field initialization

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 17 14:40:34 PDT 2013


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



--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-09-17 14:40:33 PDT ---
Simpler example:

-----
struct A
{
    this(B) { }
}

struct B
{
}

struct C
{
    A a;
}

void main()
{
    // field initialization, c.a = B(), 'a' defines ctor for 'B'
    auto c = C(B());  // error
}
-----

I'm not sure whether or not we want to support this. Should field
initialization allow implicit calls to a ctor of that field?

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