Currently, DMD will generate a call to _d_invariant for a virtual class member
even if that class is final, and neither it, nor any of it's ancestors, define
an invariant. This call, for obvious reasons, is only present in debug builds,
but really isn't needed.
As a further note, we could probably remove almost all calls to this in the
average debug build if we were doing a whole program compilation. The
compile-time cost for it would likely not be worth it as it's a debug build.
Comment #1 by robert.schadek — 2024-12-13T18:23:23Z