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

Identity issue when computing prerequisites of Application for extension #58

Closed
eMaringolo opened this issue Oct 7, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@eMaringolo
Copy link
Collaborator

When trying to extend a class in another application with EmInterface>>extend: aClass in: anApplication, for some reason the prerequisite is not the same as the one being computed, so it reports that the controller application of a class is not visible.

Application>>isBasedOn: application withRecursionSet: applicationsAlreadyChecked
  "Return whether @application is a prerequisite of the receiver."

   (applicationsAlreadyChecked includes: self)
	  ifTrue: [ ^ false ]		"The receiver failed previously, so don't check it again"
	  ifFalse: [
		 self prerequisites do: [ :prereq |
			prereq == application ifTrue: [ ^ true ]. "<--- this check"
			(prereq isBasedOn: application withRecursionSet: applicationsAlreadyChecked) ifTrue: [ ^ true ].
			applicationsAlreadyChecked add: prereq ].
		 ^false ]
@eMaringolo eMaringolo added the bug Something isn't working label Oct 7, 2020
@eMaringolo eMaringolo self-assigned this Oct 7, 2020
@eMaringolo
Copy link
Collaborator Author

The problem was that when the TonelApplications are read, the prerequisites are computed to determine its load order, but when after a TonelApplication is loaded as proper Application the prerequisite points to a EmShadowApplication, so in the isBasedOn:withRecursionSet: check described above it fails even when application and prereq have the same name, because one is an Application and the other an EmShadowApplication.

I checked first by modifying the method to also compare by name (and not just identity) and it worked, but then I modified the TonelLoader to replace references to shadow apps by the actual app after each app is loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant