Restore declarative Behavior Annex type conformance 馃 - #3248
Merged
Merged
Conversation
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
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 #3199
AdaLikeDataTypeChecker.conformsToaccepted 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
Issue3199Testregressions use external models undermodels/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 andupdated, 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
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 --checkpasses 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.