Skip to content

Commit

Permalink
Merge pull request #788 from moosetechnology/ensure-stubs-are-in-model
Browse files Browse the repository at this point in the history
Smalltalk: Ensure all stubs are in the model
  • Loading branch information
jecisc authored Jun 15, 2024
2 parents 5eddf95 + 3ed418c commit 0f15a75
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,17 @@ ImportStubMethodSpecialTest >> testStubMethodCreation [
self denyEmpty: (model allMethods select: #isStub).
self denyEmpty: model allModelMethods
]

{ #category : #tests }
ImportStubMethodSpecialTest >> testStubParentsAreInMooseModel [

| method class |
method := model entityNamed: #'Smalltalk::False.ifTrue:(Object)'.
self assert: method mooseModel isNotNil.
self assert: method isStub.

class := method parentType.
self assert: class name equals: 'False'.
self assert: class mooseModel isNotNil.
self assert: class isStub
]
9 changes: 5 additions & 4 deletions src/Moose-SmalltalkImporter/CandidateListOperator.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ Class {
{ #category : #running }
CandidateListOperator >> allCandidatesFor: invocation [

^ Array withAll: (groups at: invocation signature ifAbsent: [
^ Array withAll: (groups at: invocation signature ifAbsent: [
| stubs |
stubs := self importer ensureSmalltalkStubMethodsFor:
invocation signature.
stubs := self importer ensureSmalltalkStubMethodsFor: invocation signature.
groups at: invocation signature put: stubs.
stubs do: [ :each | model add: each ].
stubs do: [ :each |
model add: each.
each allParents do: [ :parent | parent mooseModel = model ifFalse: [ model add: parent ] ] ].
stubs ])
]

Expand Down

0 comments on commit 0f15a75

Please sign in to comment.