Bug 3606 – Problems with struct destructors and const structs

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-12-11T05:44:00Z
Last change time
2015-06-09T01:27:05Z
Assigned to
nobody
Creator
webby

Comments

Comment #0 by webby — 2009-12-11T05:44:37Z
Using DMD 2.037, trying to compile the code: //////////////////////////////// struct Foo { ~this() { } } void Bar() { const Foo f; } //////////////////////////////// Fails with the error: Error: destructor Foo.~this () is not callable using argument types () Which seems a bit strange.
Comment #1 by dfj1esp02 — 2009-12-11T07:05:10Z
Errors in 2.031: Error: destructor tmp.Foo.~this () does not match parameter types () Error: f.~this can only be called on a mutable object, not const(Foo)
Comment #2 by dfj1esp02 — 2009-12-11T07:08:40Z
Well... compiler's complaints are understandable, you are trying to do meaningless thing.
Comment #3 by yebblies — 2011-06-12T15:54:43Z
The code now compiles. (dmd2.053)
Comment #4 by k.hara.pg — 2011-06-21T06:34:18Z
I think this issue was 'temporary' fixed, not resolved. See my comment: http://d.puremagic.com/issues/show_bug.cgi?id=4338#c3 *** This issue has been marked as a duplicate of issue 4338 ***