[Issue 1164] Wrong order of memory deallocation

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Dec 26 05:37:46 PST 2016


https://issues.dlang.org/show_bug.cgi?id=1164

--- Comment #12 from safety0ff.bugz <safety0ff.bugz at gmail.com> ---
(In reply to Pieter Penninckx from comment #7)
>
> 	invariant() {
> 		if(sibling !is null) {
> 			if (sibling.fun())
> 			{ assert(true);	}
> 		}
> 	}
>

Also:
https://dlang.org/spec/contracts.html#Invariants "The code in the invariant may
not call any public non-static members of the class or struct, either directly
or indirectly. Doing so will result in a stack overflow, as the invariant will
wind up being called in an infinitely recursive manner."

--


More information about the Digitalmars-d-bugs mailing list