http://d.puremagic.com/issues/show_bug.cgi?id=9982
Igor Stepanov <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Igor Stepanov <[email protected]> 2013-04-23 07:03:08 PDT --- I've tried to simplify this bug case. My resolution: error in operation of taking address of struct member and dereference it. We must ask Don about this. struct Foo(T) { T a; this(T arg) { T* p = &a; *p = arg; } this(T arg, int) { T* p = &a; setRef(*p, arg); } static void setRef(ref T p, T v) { p = v; } } auto ct1 = Foo!int(99); //compiled, but doesn't set this.a to 99 auto ct2 = Foo!int(99, 0); //compiled, but doesn't set this.a to 99 //try with struct struct Bar { int b; } auto ct1_2 = Foo!Bar(Bar(99)); //Error auto ct2_2 = Foo!Bar(Bar(99), 0); //ICE void main() { assert(ct1.a != 99); assert(ct2.a != 99); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
