Validate mode mappings in modal EMV2 subclauses 馃 - #3254
Merged
Merged
Conversation
Reproduce mode mappings that reference modes outside their modal EMV2 subclause and require diagnostics on the offending references. Cover allowed subsets, nonmodal subclauses, inherited modes, and unresolved references with separate external models.
Require each resolved mapped mode to occur in the enclosing annex subclause in-modes list. Highlight the offending mode reference while preserving unrestricted subclauses, inherited modes, and existing unresolved-reference diagnostics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #2832
Mode mappings in a modal EMV2 subclause now report an error for each mapped mode absent from the enclosing annex's
in modeslist. Previously, mode scoping resolved any mode of the classifier, and validation did not enforce the subclause's mode restriction.Issue2832Testreproduces the issue and a mixed mapping containing both allowed and disallowed modes. It checks all three diagnostics and verifies that each highlights the offending mode reference. Separate external models cover unrestricted subclauses, allowed subsets, inherited modes, and unresolved references that should produce only their existing linking error. The regression failed before the fix because the modal diagnostic was absent; all three tests pass afterward.Validation:
clean verifywith-Dtest=Issue2832Test: 3 tests passed.clean install: 1,683 tests, 0 failures/errors/skips; all reactor projects passed, including all 301 EMV2 tests.git diff --checkpassed.Build flags:
mvn -o -T5 -s releng/osate.releng/settings.xml -Plocal -Dpr.build=true -Dsign=false -Dspotbugs=false -Dcodecoverage=false -Djavadoc=false -DfailIfNoTests=false. The focused run uses-pl :org.osate.xtext.aadl2.errormodel,:org.osate.aadl2.errormodel.tests,:org.osate.xtext.aadl2.errormodel.feature -Dtycho.localArtifacts=default; the root run uses-Dtycho.localArtifacts=ignore clean install.No dependency on another PR. The check only restricts mappings in explicitly modal annex subclauses and skips unresolved mapped modes. Existing scoping, parsing, and instantiation behavior are preserved.