Bug 18707 – Destructor of qualified objects not typechecked properly

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-04-02T14:33:47Z
Last change time
2024-12-13T18:58:06Z
Assigned to
No Owner
Creator
Andrei Alexandrescu
Moved to GitHub: dmd#19417 →

Comments

Comment #0 by andrei — 2018-04-02T14:33:47Z
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.
Comment #1 by robert.schadek — 2024-12-13T18:58:06Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19417 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB