[Pharo-dev] Duplicate IVs | Bug or feature?
marcus.denker at inria.fr
Mon Nov 4 08:23:22 EST 2013
On 04 Nov 2013, at 11:29, Noury Bouraqadi <bouraqadi at gmail.com> wrote:
> In Pharo2.0 #20625 it's possible to create two classes, one inheriting from the other, and declaring the exact same IV (attached code).
> It turns out that instances of the subclass hold two IVs with the exact name.
> When accessing the IV in the superclass, the first IV is used, while in the subclass the second IV is accessed.
> Bug or feature?
Bug. It used to raise a hard error when you tried to add the same ivar. Now I was cleaning up the SourceFileArray, which is used
while accessing source: so removing an ivar *needs* duplication for a short overlap.
So I removed the hard error, which was wrong (it should have been a warning).
In Pharo3 with the new class builder this is fixed.
More information about the Pharo-dev