Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/Fuel-Core/FLTraitCluster.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ FLTraitCluster >> materializePostInstance: aTrait with: aDecoder [

aTrait
initialize;
"#initialize sets Object as the superclass
but the superclass of traits is nil"
basicSuperclass: nil;
setName: name;
environment: environment.

Expand Down
6 changes: 6 additions & 0 deletions src/Traits-Tests/TraitTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,12 @@ TraitTest >> testTraitHaveUsersInstanceVariable [
self assert: (aClass slotNamed: #users) definingClass equals: t1
]

{ #category : 'tests' }
TraitTest >> testTraitInitialize [
"this tests that #intialize is correctly setting the superclass to nil"
self assert: Trait new superclass isNil
]

{ #category : 'tests' }
TraitTest >> testTraitRemoval [

Expand Down
6 changes: 6 additions & 0 deletions src/Traits/Trait.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ Trait >> expandedDefinitionStringFor: aPrinter [
^ aPrinter expandedTraitDefinitionString
]

{ #category : 'initialization' }
Trait >> initialize [
super initialize.
self basicSuperclass: nil
]

{ #category : 'testing' }
Trait >> isBaseTrait [
<reflection: 'Class structural inspection - Class kind testing'>
Expand Down