June 09, 2020 [Issue 20917] stacking alias this, drops data during assignment | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=20917 Stanislav Blinov <stanislav.blinov@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |stanislav.blinov@gmail.com Resolution|--- |INVALID --- Comment #1 from Stanislav Blinov <stanislav.blinov@gmail.com> --- void opAssign(T a) { data = a; // hate = outer; Needs implicit conversion. // outer converts to inner. // hate = inner; Needs implicit conversion. // No implicit conversion found. Lookup through hate's alias this. // getAliasThis(hate) -> outer. // outer = inner; Needs implicit conversion. // No implicit conversion found. Lookup through outer's alias this. // getAliasThis(outer) -> inner. // inner = inner; assert(data == a); // makes incorrect assumption } You need to define opAssign(T) for hate. -- | ||||
June 09, 2020 [Issue 20917] stacking alias this, drops data during assignment | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=20917 crazymonkyyy@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |WONTFIX -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply