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

--- Comment #2 from Dmitry Olshansky <[email protected]> ---
(In reply to Kenji Hara from comment #1)
> For virtual class methods, their invariant call should be virtual. For
> example:
> 
> class C
> {
>     void foo() {}
> }
> 
> class D : C
> {
>     invariant {}
> }
> 
> void main()
> {
>     C c = new D;
>     c.foo();    // should check D.invariant
> }

Could it do a test on invariant v-table slot to see if it's a default
invariant?
Then if it's the default - just test for null inline, if not - call that slot.

--

Reply via email to