final conflicts with override?
davidl
davidl at nospam.org
Tue Jun 16 19:37:11 PDT 2009
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/
More information about the Digitalmars-d
mailing list