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

#reference auto-generation seems to be corrupted [incomplete issue, in progress] #334

Open
Assargadon opened this issue Sep 8, 2023 · 1 comment
Labels
stale Closed after 6 months to limit bug bankruptcy; can be reopened if still important

Comments

@Assargadon
Copy link
Contributor

Assargadon commented Sep 8, 2023

That's how MARelationDescription >> reference is implemented:

MARelationDescription >> reference [
	"The reference within a ==*MARelationDescription*== is calculated automatically from all the classes of the receiver, if set to ==nil==. By setting the reference to a ==*MAContainer*== instance it is possible to customize the reference description."

	^ super reference ifNil: [ self commonClass magritteTemplate magritteDescription ]
]

The trouble is that super reference is never nil, because it has its own ifNil generator:

MAReferenceDescription >> reference [
	reference ifNil: [ reference := self class defaultReference ].
	^ reference
		display: self displayBlockOrSymbol;
		yourself
]

Therefore, commonClass-based generator is actually never called.

This ticket is in progress. Things to describe: unintuitive defaultReferences and mistake (well, I assume it's a mistake) in managing the commonClass if there are no classes. A latter, I believe, forced the author to add extra unneeded magritteTemplate into...MAContainer, I believe, but need to re-check.

@Assargadon Assargadon changed the title #reference auto-generation sems to be corrupted [incomplete issue, in progress] #reference auto-generation seems to be corrupted [incomplete issue, in progress] Sep 8, 2023
Assargadon added a commit to Assargadon/magritte-python that referenced this issue Sep 8, 2023
I don't understand why `self.assertIsInstance(self.inst1.reference, MAStringDescription)`
Same for `self.assertIsInstance(self.inst1.commonClass(), MAPriorityContainer)`

It's a half-fix, because `reference is None` condition never met - supercalss always returns non-nill, see magritte-metamodel/magritte#334
Copy link

stale bot commented Dec 15, 2023

To limit bug bankruptcy (see https://www.joelonsoftware.com/2012/07/09/software-inventory/) this issue has been automatically marked as stale because it has not had any activity in 6 months. If no further activity occurs, it might be closed. If this issue remains important to you, please comment to reactivate the issue. Thank you for your contributions.

@stale stale bot added the stale Closed after 6 months to limit bug bankruptcy; can be reopened if still important label Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Closed after 6 months to limit bug bankruptcy; can be reopened if still important
Projects
None yet
Development

No branches or pull requests

1 participant