feat(model-api): check if is sub-concept but only based on the IConceptReference #819
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In MPS, we mostly have MPSConcepts, SimpleConcepts and GeneratedConcepts at runtime.
If we use MPSConcept, then the IConcept.isSubConceptOf assumes that the superConcept is an MPSConcept. If not, then the method returns false. This makes it difficult to check if this and superConcept are the same superConcept if is a SimpleConcept.
GeneratedConcept.isSubConceptOf checks the equality with the superConcept, which means if the superConcept is a different object that structurally may represent the same Concept then it returns false (e.g. a GeneratedConcept and a SimpleConcept with the same Concept UID and name would return false).
In order to simplify all these cases we could just check the UID of the Concept and assume that if UID matches then the Concepts should also be the same. This implementation is similar to how SConceptAdapterById checks the isSubConcept in MPS. This adapter is often used in MPS, that is wrapped by MPSConcept at runtime.
To be verified by reviewers