Le 15/04/2017 à 08:14, Nicolai Hess a écrit :
How to reproduce:
"Create a Trait" Trait named:#TRoot uses:{} package:'MyPackage'.
"Add some methods" (Smalltalk classOrTraitNamed:'TRoot') compile:'trootA'. (Smalltalk classOrTraitNamed:'TRoot') compile:'trootB'. (Smalltalk classOrTraitNamed:'TRoot') compile:'trootC'.
"Create another Trait using this Trait" Trait named:#TRootUser uses:{(Smalltalk classOrTraitNamed:'TRoot')} package:'MyPackage'.
"Add more methods. Note, methods still added on TRoot" (Smalltalk classOrTraitNamed:'TRoot') compile:'troot1'. (Smalltalk classOrTraitNamed:'TRoot') compile:'troot2'. (Smalltalk classOrTraitNamed:'TRoot') compile:'troot3'.
"Trait TRootUser should not have any local methods" (RPackageOrganizer default packageNamed:'MyPackage') methods inspect.
Exprected outcome: All methods are only defined on Trait TRoot. Actual outcome: Methods from TRoot added before creating the Trait that uses TRoot, are *added* to the using trait, but only in the RPackage, the trait, *using* TRoot still *knows* that it does not hold any local methods:
TRootUser localMethods. -> "#()" TRoot localMethods -> "{TRoot>>#troot1. TRoot>>#troot3. TRoot>>#trootC. TRoot>>#trootB. TRoot>>#trootA. TRoot>>#troot2}"
Now, if we store a snapshot of this package, the RGMethodDefinitions, wrongly assigned to trait TRootUser, will be flattened into that trait.
This is cool that it was found with a reproducible case. We got the same problem at Synectique. -- Cyril Ferlicot https://ferlicot.fr http://www.synectique.eu 2 rue Jacques Prévert 01, 59650 Villeneuve d'ascq France