Skip to content

Commit

Permalink
This is fixing a bug while loading code.
Browse files Browse the repository at this point in the history
In Pharo 7, the loading of code is using a cache for MCDefinitions. 
When you create a new definition, it checks if one equivalent was already created, if yes, it return this one.

The equality of MCClassTraitDefinition does not take the category into account and I got bug while loading code because the MCClassTraitDefinition was wrong because it found one with another category.
  • Loading branch information
jecisc committed Nov 7, 2019
1 parent ecc855d commit cca78ad
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/Monticello/MCClassTraitDefinition.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ MCClassTraitDefinition class >> baseTraitName: aString classTraitComposition: cl

{ #category : #comparing }
MCClassTraitDefinition >> = aDefinition [
^ (super = aDefinition)
and: [baseTrait = aDefinition baseTrait
and: [self classTraitCompositionString = aDefinition classTraitCompositionString]]


^ super = aDefinition
and: [ baseTrait = aDefinition baseTrait
and: [ self classTraitCompositionString = aDefinition classTraitCompositionString
and: [ category = aDefinition category ] ] ]
]

{ #category : #visiting }
Expand Down Expand Up @@ -91,8 +90,8 @@ MCClassTraitDefinition >> hash [
| hash |
hash := String stringHash: baseTrait initialHash: 0.
hash := String stringHash: self classTraitCompositionString initialHash: hash.
^hash

hash := String stringHash: category initialHash: hash.
^ hash
]

{ #category : #initialization }
Expand Down

0 comments on commit cca78ad

Please sign in to comment.