digitalmars.D.bugs - [Issue 18707] New: Destructor of qualified objects not typechecked
- d-bugmail puremagic.com (36/36) Apr 02 2018 https://issues.dlang.org/show_bug.cgi?id=18707
https://issues.dlang.org/show_bug.cgi?id=18707 Issue ID: 18707 Summary: Destructor of qualified objects not typechecked properly Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: andrei erdani.com Consider: int[] sneaky; struct A { private int[] innocent; ~this() { sneaky = innocent; } } void main() { immutable a = A([1, 2, 3]); { auto b = a; } sneaky[1] = 42; // oops import std.stdio; writeln(a.innocent); // ooooops } The destructor should not unqualify the structure, or should in limited ways. --
Apr 02 2018