Allow compatible data type extensions in Behavior Annex 馃 - #3262
Merged
Merged
Conversation
Reproduce rejected assignments and expression operands between base data classifiers and direct or transitive extensions with matching representations. Cover both directions, type and implementation extensions, communication actions, call parameters, arrays, and iteration through embedded AADL validation. Include integer, real, and Boolean literals on both sides of declared operands and together in compound Boolean expressions. Require literals to preserve the declared operand classifier and retain rejection of unrelated or sibling classifiers, representation changes, and mismatched array shapes. Against the original checker, the two acceptance tests fail on extension-related type errors and the rejection control passes without unrelated AADL errors.
Accept base and extended data classifiers in either direction when their declared data representations agree and existing array-shape checks pass. Select the base classifier for mixed expressions so the result does not depend on operand order. Preserve rejection of sibling and unrelated classifiers, representation changes, and type/implementation realization pairs. Update the existing nominal-type regression, add the issue #3261 characterization records, and document the compatibility policy and instance-property boundary. Validation: all 15 focused tests pass, including integer, real, and Boolean literal expressions and rejection controls. The clean offline root reactor passes 143 projects and 1,700 tests with no failures, errors, or skips.
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 #3261.
The BA checker rejected a base data classifier and its extension because it required exact qualified-name equality. Allow compatibility in both directions along an actual extension chain when the data representations agree and existing array-shape checks pass. Mixed base/extension expressions select the base classifier independently of operand order.
This includes direct and transitive data-type and data-implementation extensions. Unrelated and sibling classifiers, incompatible representations, and type/implementation realization pairs remain distinct. The rule uses declared properties; effective instance properties and additional range constraints remain outside this change.
Issue3261Testuses a separate AADL model project with the minimal reported example, broader assignment/expression/communication/iteration controls, and exact rejection diagnostics. Expressions include integer, real, and Boolean literals on both sides of declared operands and together in compound Boolean expressions. Negative cases check that literals do not erase the operand classifier or permit unrelated assignments. Before the fix, its two acceptance tests failed on the intended type errors and its rejection test passed. The existingIssue3199Testnow accepts its base/child assignment while preserving its unrelated-classifier and realization checks. The implementation and expected-output updates follow the regression in a separate commit.Validation commands use JDK 21 and offline Tycho:
Results: the focused run passed all 15 tests (3 new regressions, 7 existing type-conformance tests, and 5 characterization tests). The final clean root reactor passed all 143 projects and 1,700 tests across 15 bundles, including all 217 BA tests, with zero failures, errors, or skips. The final run compared golden files with regeneration disabled; counts were verified against fresh Surefire reports and the build log.
git diff --checkpassed.Dependencies: based directly on master, with no unmerged PR dependencies. This is separate from the complete-state work in #3260. The compatibility relaxation is an explicit OSATE policy; Annex D does not prescribe classifier substitutability.