digitalmars.D - Abstract functions with bodies
- Ary Manzana (11/11) Mar 18 2007 While porting DMD code to Java I noticed that error reporting for
- Tom (8/24) Mar 18 2007 Right from the docs (http://www.digitalmars.com/d/attribute.html#abstrac...
- Ary Manzana (4/31) Mar 19 2007 I never thought of that, but it pretty useful. Great! :-)
While porting DMD code to Java I noticed that error reporting for
abstract functions with bodies is disables. The following code gives no
errors:
class X {
abstract int bla() {
return 1;
}
}
Why is the error reporting silenced for this (in
FuncDeclaration::semantic )?
Ary
Mar 18 2007
Ary Manzana escribió:
While porting DMD code to Java I noticed that error reporting for
abstract functions with bodies is disables. The following code gives no
errors:
class X {
abstract int bla() {
return 1;
}
}
Why is the error reporting silenced for this (in
FuncDeclaration::semantic )?
Ary
Right from the docs (http://www.digitalmars.com/d/attribute.html#abstract):
"Functions declared as abstract can still have function bodies. This is
so that even though they must be overridden, they can still provide
'base class functionality.'"
Regards,
--
Tom;
Mar 18 2007
Tom escribió:Ary Manzana escribió:I never thought of that, but it pretty useful. Great! :-) Thanks, AryWhile porting DMD code to Java I noticed that error reporting for abstract functions with bodies is disables. The following code gives no errors: class X { abstract int bla() { return 1; } } Why is the error reporting silenced for this (in FuncDeclaration::semantic )? AryRight from the docs (http://www.digitalmars.com/d/attribute.html#abstract): "Functions declared as abstract can still have function bodies. This is so that even though they must be overridden, they can still provide 'base class functionality.'" Regards, -- Tom;
Mar 19 2007








Ary Manzana <ary esperanto.org.ar>