[Issue 5060] New: Order of interface implementations affects code

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Oct 15 12:11:01 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=5060

           Summary: Order of interface implementations affects code
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2010-10-15 12:10:27 PDT ---
Code:

interface Foo
{
   final void run() { writeln("foo"); }
}

interface Bar
{
   final void run() { writeln("bar"); }
}

class One : Foo, Bar
{
}

class Two : Bar, Foo
{
}

void main()
{
   with (new One)
   {
       run();  // writes foo
   }

   with (new Two)
   {
       run();  // writes bar
   }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list