Skip to content

Commit

Permalink
Revert "Revert "21876 Re-evaluating of class definition with slots cl…
Browse files Browse the repository at this point in the history
…eans the class instance variables""

This reverts commit fa3ea82.
I am reintroduced the changes performed by Guille,
so I can recheck the errors and fix the problem.
  • Loading branch information
tesonep committed Jan 2, 2019
1 parent 6de2c92 commit 9f8fd52
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/Hermes/HEInstaller.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ HEInstaller >> build: aHEClass [
sharedVariables: (self asClassVariables:aHEClass classVariables);
sharedPools: aHEClass sharedPools;
category: aHEClass category;
classSlots: (self asSlots: aHEClass classInstancevariables) ].
classSlots: (self asSlots: aHEClass classInstancevariables);
copyClassSlotsFromExistingClass ].

self processTraitsFrom: aHEClass in: newClass.

Expand Down
13 changes: 8 additions & 5 deletions src/Kernel/Class.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,8 @@ Class >> subclass: aSubclassSymbol layout: layoutClass slots: slotDefinition cl
layoutClass: layoutClass;
slots: slotDefinition;
sharedVariables: classVarDefinition;
category: aCategorySymbol ].
category: aCategorySymbol;
copyClassSlotsFromExistingClass ].

]

Expand All @@ -1182,7 +1183,8 @@ Class >> subclass: aSubclassSymbol layout: layoutClass slots: slotDefinition c
slots: slotDefinition;
sharedVariables: classVarDefinition;
sharedPools: someSharedPoolNames;
category: aCategorySymbol ].
category: aCategorySymbol;
copyClassSlotsFromExistingClass ].

]

Expand All @@ -1205,7 +1207,8 @@ Class >> subclass: aSubclassSymbol slots: slotDefinition classVariables: classVa
superclass: self;
slots: slotDefinition;
sharedVariables: classVarDefinition;
category: aCategorySymbol ]
category: aCategorySymbol;
copyClassSlotsFromExistingClass ]
]

{ #category : #'subclass creation - slots' }
Expand All @@ -1224,8 +1227,8 @@ Class >> subclass: aSubclassSymbol slots: slotDefinition classVariables: classVa
slots: slotDefinition;
sharedVariables: classVarDefinition;
sharedPools: someSharedPoolNames;
category: aCategorySymbol ].

category: aCategorySymbol;
copyClassSlotsFromExistingClass ]
]

{ #category : #'accessing class hierarchy' }
Expand Down
3 changes: 2 additions & 1 deletion src/Monticello/MCClassDefinition.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ MCClassDefinition >> createClass [
classTraitComposition: self classTraitCompositionCompiled;
comment: comment stamp: commentStamp;
category: category;
environment: superClass environment ] ]
environment: superClass environment;
copyClassSlotsFromExistingClass ] ]
on: Warning , DuplicatedVariableError
do: [ :ex | ex resume ]
]
Expand Down
6 changes: 4 additions & 2 deletions src/SUnit-Core/ClassFactoryWithOrganization.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ ClassFactoryWithOrganization >> newClassNamed: aString subclassOf: aClass instan
sharedVariablesFromString: classVarsString;
sharedPools: '';
category: category asSymbol;
environment: self organization environment ].
environment: self organization environment;
copyClassSlotsFromExistingClass ].
self createdClasses add: newClass.
^ newClass
]
Expand All @@ -78,7 +79,8 @@ ClassFactoryWithOrganization >> newSubclassOf: aClass instanceVariableNames: ivN
sharedVariablesFromString: classVarsString;
sharedPools: '';
category: category asSymbol;
environment: self organization environment ].
environment: self organization environment;
copyClassSlotsFromExistingClass ].
self createdClasses add: newClass.
^ newClass
]
Expand Down
3 changes: 2 additions & 1 deletion src/Shift-ClassInstaller/Class.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Class >> addClassSlot: aSlot [
sharedVariablesFromString: self classVariablesString;
sharedPools: self sharedPoolsString;
category: self category;
environment: self environment]
environment: self environment;
copyClassSlotsFromExistingClass ]
]

{ #category : #'*Shift-ClassInstaller' }
Expand Down
3 changes: 2 additions & 1 deletion src/TraitsV2/Trait.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ Trait class >> named: aName uses: aTraitCompositionOrCollection slots: someSlots
category: aCategory;
traitComposition: aTraitCompositionOrCollection asTraitComposition;
classTraitComposition: aTraitCompositionOrCollection asTraitComposition classComposition;
classSlots: #() ].
classSlots: #();
copyClassSlotsFromExistingClass ].

self assert: [ trait class class = MetaclassForTraits ].
self assert: [ trait class superclass = Trait ].
Expand Down

0 comments on commit 9f8fd52

Please sign in to comment.