On Oct 1, 2013, at 10:13 AM, Norbert Hartl <norbert@hartl.name> wrote:
Am 01.10.2013 um 09:37 schrieb Marcus Denker <marcus.denker@inria.fr>:
On Oct 1, 2013, at 9:34 AM, "phil@highoctane.be" <phil@highoctane.be> wrote:
Still, why does it occur ? Normal ? I experienced that on a class with quite a number of instVars.
This seems to be a bug. When you remove / add inst vars, the offset of all those behind need to change (and all in the subclass). This is done by the ClassBuilder by recompiling (there is code somewhere to do it more intelligently, by using bytecode level IR to patch the offsets, but this is not yet active).
We need some reproducible case to fix the problem⦠because normally the class builder does the right thing, I wonder in which case there is a problem.
I have the same opinion that the behavior changed quite a bit. E.g. I can't remember that it was allowed to have shadowed instance variabels. Nowadays there is not even a warning.
Yes, that was a mistake I introduced. In Pharo2 development phase, I merged some classes. For that the first step was to move ivars from the subclass to the superclass. The resulting change was not mergable, not even with a chagneset. (I think raising an Error in the ClassBuilder is wrong, it needed to be a Warning, I (wrongly) just removed it). This has been fixed in Pharo3 with the new class builder. As it's a complete reimplemenation, there is no back port. And doing that chagne again in Pharo2 did not seem that important, but if someone fixes it we of course will include it. Marcus