Re: [Pharo-dev] Duplicate IVs | Bug or feature?
On 04 Nov 2013, at 11:29, Noury Bouraqadi wrote: > Hi, > > 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. Marcus
Re: [Pharo-dev] Duplicate IVs | Bug or feature?
Hey, This is a feature but it had side effect problems. For instance, in the inspector you can see twice the instance variable of that name, 1 being nil and the other one having the correct value. Therefore in Pharo 3.0 with the new class builder / object layout this feature was removed. Now your code will raise an Error (DuplicatedSlot) and you cannot save your class any more (a popup with the error is shown). The error tells you which instance variable is duplicated so you can fix it by removing the duplicated instance variable and saving again the class. 2013/11/4 Luc Fabresse > > > > > 2013/11/4 Luc Fabresse > >> >> perhaps related to the new object layout. >> > > arg no, not in 2.0 I guess > > Luc > > >> >> Luc >> >> 2013/11/4 Noury Bouraqadi >> >>> Hi, >>> >>> 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? >>> >>> Noury >>> Ecole des Mines de Douai >>> http://car.mines-douai.fr/noury >>> -- >>> >>> >>> >>> >>> >>> >>> Afin de contribuer au respect de l'environnement, >>> >>> >>> merci de n'imprimer ce courriel qu'en cas de necessite >>> >>> >>> >>> >>> >>> Please consider the environment before you print >>> >>> >>> >>> >>> >>> >> >
Re: [Pharo-dev] Duplicate IVs | Bug or feature?
2013/11/4 Luc Fabresse > > perhaps related to the new object layout. > arg no, not in 2.0 I guess Luc > > Luc > > 2013/11/4 Noury Bouraqadi > >> Hi, >> >> 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? >> >> Noury >> Ecole des Mines de Douai >> http://car.mines-douai.fr/noury >> -- >> >> >> >> >> >> >> Afin de contribuer au respect de l'environnement, >> >> >> merci de n'imprimer ce courriel qu'en cas de necessite >> >> >> >> >> >> Please consider the environment before you print >> >> >> >> >> >> >
Re: [Pharo-dev] Duplicate IVs | Bug or feature?
perhaps related to the new object layout. Luc 2013/11/4 Noury Bouraqadi > Hi, > > 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? > > Noury > Ecole des Mines de Douai > http://car.mines-douai.fr/noury > -- > > > > > > > Afin de contribuer au respect de l'environnement, > > > merci de n'imprimer ce courriel qu'en cas de necessite > > > > > > Please consider the environment before you print > > > > > >
[Pharo-dev] Duplicate IVs | Bug or feature?
Hi, 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? Noury Ecole des Mines de Douai http://car.mines-douai.fr/noury -- Afin de contribuer au respect de l'environnement, merci de n'imprimer ce courriel qu'en cas de necessite Please consider the environment before you print TestDuplicateIVs.st Description: Binary data