On Sat, 30 Jan 2010 10:56:28 -0500, Ary Borenszweig <[email protected]> wrote:

Walter Bright wrote:
 http://www.digitalmars.com/d/1.0/changelog.html
http://ftp.digitalmars.com/dmd.1.056.zip
  http://www.digitalmars.com/d/2.0/changelog.html
http://ftp.digitalmars.com/dmd.2.040.zip
 Thanks to the many people who contributed to this update!

Very nice! Each release kills a lot of bugs and adds small but very powerful features.

About the interface functions, this compiles:

--
import std.stdio;

interface One {

   final void foo() {
     writefln("One");
   }

}

interface Two {

   final void foo() {
     writefln("Two");
   }

}

class X : One, Two {
}

class Y : Two, One {
}

void main() {
   X x = new X();
   x.foo(); // prints "One"
   Y y = new Y();
   y.foo(); // prints "Two"
}
--

Is this intended behaviour? Might leads to obscure bugs...

This looks like a form of function hijacking, so it should be a accepts-invalid bug.

Reply via email to