Skip to content

Allow compatible data type extensions in Behavior Annex 馃 - #3262

Merged
lwrage merged 2 commits into
masterfrom
3261_allow_compatible_type_extensions
Sep 19, 2026
Merged

lwrage merged 2 commits into
masterfrom
3261_allow_compatible_type_extensions

Conversation

@lwrage

@lwrage lwrage commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

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.

Issue3261Test uses 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 existing Issue3199Test now 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:

mvn -o -T5 -s releng/osate.releng/settings.xml -Plocal \
  -pl :org.osate.ba,:org.osate.xtext.aadl2.ba,:org.osate.ba.tests,:org.osate.ba.feature \
  -Dtycho.localArtifacts=default -Dpr.build=true -Dsign=false \
  -Dspotbugs=false -Dcodecoverage=false -Djavadoc=false \
  -Dtest=Issue3261Test,Issue3199Test,BehaviorAnnexCharacterizationTest,BehaviorAnnexValidatedDiagnosticsTest \
  -DfailIfNoTests=false -Dosate.ba.tests.regenerate=true clean verify

mvn -o -T5 -s releng/osate.releng/settings.xml -Plocal \
  -Dtycho.localArtifacts=ignore -Dpr.build=true -Dsign=false \
  -Dspotbugs=false -Dcodecoverage=false -Djavadoc=false \
  -DfailIfNoTests=false clean install

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 --check passed.

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.

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.
@lwrage
lwrage merged commit ed1e539 into master Sep 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow compatible data type extensions in Behavior Annex expressions 馃

2 participants