[Issue 13246] New: _d_invariant called on final class without invariants
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Sun Aug  3 12:39:30 PDT 2014
    
    
  
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 at puremagic.com
          Reporter: blah38621 at 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.
--
    
    
More information about the Digitalmars-d-bugs
mailing list