Skip to content

Commit

Permalink
unify hasSlotNamed: in AbractLayout and ClassDescription
Browse files Browse the repository at this point in the history
hasSlotNamed: just checks "visible" slots, the one on AbractLayout all. We should check always all slots (visibility means just that they are not shown when you ask for a list, this is all quite crude anyway and will be generalised into a "view" concept later.)

fixes #3650
  • Loading branch information
MarcusDenker committed Jun 27, 2019
1 parent b82e847 commit c4534c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Kernel/ClassDescription.class.st
Expand Up @@ -747,9 +747,10 @@ ClassDescription >> hasSlot: aSlot [

{ #category : #slots }
ClassDescription >> hasSlotNamed: aString [
"Return true whether the receiver defines an instance variable named aString."
"Return true whether the receiver defines an instance variable named aString.
this includs non-visible slots"

^ self allSlots anySatisfy: [:slot | slot name = aString]
^ self classLayout hasSlotNamed: aString
]

{ #category : #'instance variables' }
Expand Down
2 changes: 2 additions & 0 deletions src/Slot-Core/AbstractLayout.class.st
Expand Up @@ -73,6 +73,8 @@ AbstractLayout >> hasSlot: aSlot [

{ #category : #api }
AbstractLayout >> hasSlotNamed: aString [
"Return true whether the receiver defines an instance variable named aString.
this includs non-visible slots"
^self allSlots anySatisfy: [:slot | slot name = aString ]
]

Expand Down

0 comments on commit c4534c5

Please sign in to comment.