| <<O>> Difference Topic FieldTypeOverriding (r1.2 - 02 Aug 2003 - DanielBonniot) |
| Added: | |
| > > | This is implemented in the DevelopmentVersion (future 0.9.1) of the compiler. -- DanielBonniot - 02 Aug 2003 |
| <<O>> Difference Topic FieldTypeOverriding (r1.1 - 21 Jul 2003 - DanielBonniot) |
| Added: | |
| > > |
%META:TOPICINFO{author="DanielBonniot" date="1058792358" format="1.0" version="1.1"}%
%META:TOPICPARENT{name="FeatureProposals"}%
It is often useful to declare that, in a subclass, a certain field of the superclass has a more precise type. To be safe, this feature only applies to final fields.
class A
{
final Reader reader;
}
class B extends A
{
override FileReader reader;
}
The new type must be a subtype of the original type, and the original field must be final.
Implementation notes: the type in the default constructors of B must be changed. For the field access methods, the get method can simply be overriden.
-- DanielBonniot - 21 Jul 2003 |
| Topic FieldTypeOverriding . { View | Diffs | r1.2 | > | r1.1 | More } |
|
Revision r1.1 - 21 Jul 2003 - 12:59 GMT - DanielBonniot Revision r1.2 - 02 Aug 2003 - 08:24 GMT - DanielBonniot |
Copyright © 1999-2003 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems regarding TWiki? Send feedback. |