pharo
pharo copied to clipboard
For traits variables on the class side do not to load correctly when the trait uses other traits
When creating a trait with class instance variables that uses other traits, if that trait is committed to a repository and loaded in an image, the class instance variables are lost.
To reproduce, run first the following code, step by step, to create a class, a trait and two traits used by the first trait.
Trait named: #Trait1_1
instanceVariableNames: ''
package: 'Haba'.
Trait named: #Trait1_2
instanceVariableNames: ''
package: 'Haba'.
Trait named: #Trait9
uses: Trait1_1 + Trait1_2
instanceVariableNames: ''
package: 'Haba'.
Trait9 classTrait
uses: Trait1_1 classTrait + Trait1_2 classTrait
instanceVariableNames: 'var1'.
Object subclass: #Haba9
uses: Trait9
instanceVariableNames: ''
classVariableNames: ''
package: 'Haba'.
Create a repository, add the package to it and commit it. Then unload and reload the package. When reloading the class instance variable is not added to the trait.
Iceberg also reports a change:
Could reproduce this in
Pharo 10.0 - 64bit (stable)traitstest.image Pharo10.0.0 Build information: Pharo-10.0.0+build.529.sha.84ce6785e2a0778583f749bfe471c0eed8f13b7b (64 Bit) Unnamed
Hi andrei
could you check your scenario in P11 because I know that they fixed a bug recently on traits.
I tried it now in Pharo 11 and I get the same behaviour.
Pharo 11.0 - 64bit (development version, latest) traits.image Pharo11.0.0 Build information: Pharo-11.0.0+build.198.sha.05cd6583896f68c39494581ab454ff7f03f40b71 (64 Bit) Unnamed
tx!