#dbugfix 17592

SimonN eiderdaus at gmail.com
Thu Mar 22 02:16:56 UTC 2018


On Wednesday, 21 March 2018 at 13:55:16 UTC, Adam D. Ruppe wrote:
`emplace` is ALREADY `@nogc`

Interesting -- I checked the phobos source, and none of the 
`emplace` or `emplaceRef` are declared `@nogc`, yet the unittests 
marked as `@nogc` pass.

Does the compiler infer nogc-ness of `emplace` at instantiation?

> class A { @nogc ~this() {} }
> class B : A { ~this() {} }

My first hunch was that B's yes-gc-destructor should be illegal 
when A's descructor is `@nogc`, but it can be legal because 
destructors in a hierarchy are chained, not overridden. Seems 
like there is no way to ensure at child-class-compile-time that 
all child classes of A must be designed `@nogc`.

-- Simon


More information about the Digitalmars-d mailing list