Skip to content

Restore declarative Behavior Annex type conformance 馃 - #3248

Merged
lwrage merged 2 commits into
masterfrom
3199_restore_declarative_type_conformance
Sep 18, 2026
Merged

lwrage merged 2 commits into
masterfrom
3199_restore_declarative_type_conformance

Conversation

@lwrage

@lwrage lwrage commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #3199

AdaLikeDataTypeChecker.conformsTo accepted every pair of types, so assignments, communications, calls, and binary expressions could silently mix incompatible types. Source validation now compares case-insensitive qualified classifier names, statically declared Data Model representations, array ranks, and known extents. Universal real literals remain compatible with fixed-point values; typed numerics do not widen implicitly.

The change also preserves classifier and array information in expression results, corrects nested-array iterator typing, and makes declaration initializers use the same conformance relation. Resolution errors still gate strict-model checks, while conformance errors no longer suppress independent initialization and legality diagnostics. Affected fixtures, standard example 7, and characterization goldens are corrected and reviewed.

Regression coverage

Seven Issue3199Test regressions use external models under models/issue3199. The original four-transition model now reports exactly one error per transition. Additional cases cover classifier identity, numeric and array compatibility, dequeues/calls/internal sends, fixed-point literals, grouping and updated, Boolean expression result types, and simultaneous type/initialization/legality errors. The regressions demonstrated their failures before the corresponding corrections.

The branch contains the regression commit followed by the production-fix commit.

Validation

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

Passed all 143 reactor projects and 1,675 tests across 15 test bundles, with zero failures, errors, or skips. This includes 214 tests in org.osate.ba.tests, all seven #3199 regressions, and normal golden comparisons with regeneration disabled. git diff --check passes and the worktree is clean.

Scope and residual risk

Targets master, including merged PR #3247 for communication and call signatures. The earlier grammar, extent, precedence, and property-reference fixes are already in the base; there are no unmerged dependencies or merge-order constraints.

Exact classifier-name equality deliberately rejects extension and type/implementation pairs. Source checks use declared properties; effective instance values, contained overrides, and prototype bindings remain tracked separately in #3229. The additional range/iterator and time/index/extent legality checks from the older umbrella plan are outside this PR.

Exercise assignments, communication actions, call parameters, and binary
operators through external Behavior Annex models. Require exact classifier
names, Ada numeric compatibility, matching array ranks and known extents,
and real literals for fixed-point initializers. Also require independent
initialization and legality diagnostics to survive a type error.

The six focused tests fail before the fix: the mismatch models report no
errors and the valid fixed-point initializer is rejected. The additional
validation-gate regression reports only the type error, hiding two other
diagnostics.

Boolean expressions must retain a classifier-typed operand even when the
other operand is a literal. The added case reproduces a missing assignment
diagnostic when the Boolean literal appears first.
Compare exact classifier names, declared Data Model representations, array
ranks, and known extents at the existing assignment, communication, call,
iterator, and operand checks. Preserve unknown references without inventing
mismatches, retain classifier and array metadata in expression results, and
allow universal
real literals for fixed-point initializers and expressions.

Separate strict-model resolution from conformance so type errors cannot
suppress independent initialization and legality diagnostics. Correct nested
array iterator typing and read dimensions from the array classifier.

Update affected fixtures, the standard example, and reviewed characterization
goldens. Document the nominal source policy and track instance-effective
properties and prototype bindings separately under #3229.

Fixes #3199
@lwrage
lwrage merged commit b8ac04c into master Sep 18, 2026
1 check passed
@lwrage
lwrage deleted the 3199_restore_declarative_type_conformance branch September 18, 2026 16:31
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.

Behavior Annex type conformance is disabled, so no type mismatch is reported 馃

2 participants