www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13246] New: _d_invariant called on final class without

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

          Issue ID: 13246
           Summary: _d_invariant called on final class without invariants
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: contracts, performance
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: blah38621 gmail.com

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.

--
Aug 03 2014