Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smalltalk: Ensure all stubs are in the model #788

Merged
merged 1 commit into from
Jun 15, 2024
Merged
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
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
Loading