You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider the code from issue 20650:
class Foo { ~this() { new int; } }
void main() { new Foo; }
This runs into core.exception.InvalidMemoryOperationError@src/core/exception.d(647): Invalid memory operation .
The reason is that the GC may not be invoked during finalizers, ie. when destructors are run. There is almost never a reason to do this; however, this should still be documented in the language spec at https://dlang.org/spec/class.html#destructors .
The text was updated successfully, but these errors were encountered:
FeepingCreature (@FeepingCreature) reported this on 2020-03-09T10:13:39Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=20651
Description
Consider the code from issue 20650: class Foo { ~this() { new int; } } void main() { new Foo; } This runs into core.exception.InvalidMemoryOperationError@src/core/exception.d(647): Invalid memory operation . The reason is that the GC may not be invoked during finalizers, ie. when destructors are run. There is almost never a reason to do this; however, this should still be documented in the language spec at https://dlang.org/spec/class.html#destructors .The text was updated successfully, but these errors were encountered: