[Issue 19767] Classes that inherit from an interface can override static interface methods

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 27 18:18:42 UTC 2019


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

Basile-z <b2.temp at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b2.temp at gmx.com
           Hardware|x86_64                      |All
                 OS|Linux                       |All
           Severity|enhancement                 |normal

--- Comment #1 from Basile-z <b2.temp at gmx.com> ---
I don't know if the report is valid.

1. You can still call the interface version of foo, e.g `(new C).D.foo();`
2. C.foo() is not virtual and does not call the inherited D.foo().

Because 2, the specs are respected. It's not an override but rather a case of 
hijacking.

--


More information about the Digitalmars-d-bugs mailing list