Ary Borenszweig wrote:
You wouldn't have to break your head if implementing an interface meant
"having the methods declared in that interface". No error should appear
in C2.
What's the rationale behind this behaviour?
Naming collisions and different library versions. In practice, I suspect
this comes up very rarely. An example:
Time #1:
module library.something;
interface TheInterface
{
}
module mycode.mymodule;
class TheBaseClass
{
void frob () {}
}
class TheClass : TheBaseClass, TheInterface
{
}
Time #2:
module library.something;
interface TheInterface
{
// hey, that's new
void frob ();
}
module mycode.mymodule;
class TheBaseClass
{
void frob () {}
}
class TheClass : TheBaseClass, TheInterface
{
// wait, that frob doesn't do the right thing
}