Summary: Multiple-inheritance of Interfaces results in
                    final/static method/function hijacking
           Product: D
           Version: D2
          Platform: All
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Rob Jacques <> 2010-07-07 07:34:47 PDT ---
Essentially, the first matching final/static function is chosen when a class
implements two interfaces with final/static methods:

interface Alive { final bool isDead() { return false; } }
interface Dead  { final bool isDead() { return true;  } }

class Cat1 : Alive, Dead {}
class Cat2 : Dead , Alive{}

void main(string[] args) {
    Cat1 c1 = new Cat1;
    Cat2 c2 = new Cat2;

    assert( c2.isDead);

This seems to be another case of function hijacking. It may be similar in root
cause to bug 3706: delegates of interfaces with multiple inheritance fail

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to