|
Archives
D Programming
digitalmars.Ddigitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger D.gnu D C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D - final conflicts with override?
interface v
{
void func();
}
interface d:v
{
void d();
}
interface m:v
{
void m();
}
interface r:d,m
{
void r();
}
class c:r
{
final override void func(){};
void d(){}
void m(){}
void r(){}
}
This snippet doesn't compile.
final can't overlap the semantic of override.
class c
{
void cfunc(){}
}
class b:c
{
final void cfun(){};
// what if above just a typo of cfunc?
final override void cfunc(){}
// this doesn't have such problem, it asks the compiler if there's a cfunc
exist in the base class or interface
}
--
使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/
Jun 16 2009
|