From e2fc8d09268e39bccc98a85b0194c42f4150a253 Mon Sep 17 00:00:00 2001 From: Lutz Wrage Date: Fri, 18 Sep 2026 15:47:35 -0400 Subject: [PATCH 1/2] Add regression test for issue #3261 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. --- .../models/issue3261/.gitignore | 2 + .../models/issue3261/.project | 18 ++ .../issue3261/IncompatibleExtensions.aadl | 107 +++++++++++ .../models/issue3261/Issue3261.aadl | 58 ++++++ .../models/issue3261/TypeExtensions.aadl | 171 ++++++++++++++++++ .../src/org/osate/ba/tests/Issue3261Test.java | 116 ++++++++++++ 6 files changed, 472 insertions(+) create mode 100644 ba/org.osate.ba.tests/models/issue3261/.gitignore create mode 100644 ba/org.osate.ba.tests/models/issue3261/.project create mode 100644 ba/org.osate.ba.tests/models/issue3261/IncompatibleExtensions.aadl create mode 100644 ba/org.osate.ba.tests/models/issue3261/Issue3261.aadl create mode 100644 ba/org.osate.ba.tests/models/issue3261/TypeExtensions.aadl create mode 100644 ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3261Test.java diff --git a/ba/org.osate.ba.tests/models/issue3261/.gitignore b/ba/org.osate.ba.tests/models/issue3261/.gitignore new file mode 100644 index 00000000000..afce51184c6 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3261/.gitignore @@ -0,0 +1,2 @@ +/.aadlbin-gen/ +/instances/ diff --git a/ba/org.osate.ba.tests/models/issue3261/.project b/ba/org.osate.ba.tests/models/issue3261/.project new file mode 100644 index 00000000000..5cdfd2cb42e --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3261/.project @@ -0,0 +1,18 @@ + + + issue3261 + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + + org.osate.core.aadlnature + org.eclipse.xtext.ui.shared.xtextNature + + diff --git a/ba/org.osate.ba.tests/models/issue3261/IncompatibleExtensions.aadl b/ba/org.osate.ba.tests/models/issue3261/IncompatibleExtensions.aadl new file mode 100644 index 00000000000..426d4b98f52 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3261/IncompatibleExtensions.aadl @@ -0,0 +1,107 @@ +-- Copyright (c) 2004-2026 Carnegie Mellon University and others. (see Contributors file). +-- All Rights Reserved. +-- +-- NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY +-- KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE +-- OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT +-- MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. +-- +-- This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 +-- which is available at https://www.eclipse.org/legal/epl-2.0/ +-- SPDX-License-Identifier: EPL-2.0 +-- +-- Created, in part, with funding and support from the United States Government. (see Acknowledgments file). +-- +-- This program includes and/or can make use of certain third party source code, object code, documentation and other +-- files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system +-- configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and +-- conditions contained in any such Third Party Software or separate license file distributed with such Third Party +-- Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party benefici- +-- aries to this license with respect to the terms applicable to their Third Party Software. Third Party Software li- +-- censes only apply to the Third Party Software and not any other portion of this program or this program as a whole. + +package IncompatibleExtensions +public +with Data_Model; + +data integer_type +properties + Data_Model::Data_Representation => Integer; +end integer_type; + +data child_integer extends integer_type +end child_integer; + +data sibling_integer extends integer_type +end sibling_integer; + +data changed_representation extends integer_type +properties + Data_Model::Data_Representation => Float; +end changed_representation; + +data opaque +end opaque; + +data numeric_opaque extends opaque +properties + Data_Model::Data_Representation => Integer; +end numeric_opaque; + +data real_type +properties + Data_Model::Data_Representation => Float; +end real_type; + +data boolean_type +properties + Data_Model::Data_Representation => Boolean; +end boolean_type; + +data child_boolean extends boolean_type +end child_boolean; + +data unrelated_boolean +properties + Data_Model::Data_Representation => Boolean; +end unrelated_boolean; + +abstract host +end host; + +abstract implementation host.impl +annex behavior_specification {** + variables + base_value : integer_type := 1; + child_value : child_integer := 2; + sibling_value : sibling_integer := 3; + real_value : changed_representation := 1.0; + opaque_value : opaque; + numeric_value : numeric_opaque := 1; + unrelated_real : real_type := 0.0; + derived_flag : child_boolean := true; + unrelated_flag : unrelated_boolean := false; + base_array[2] : integer_type; + larger_array[3], matrix[2][2] : child_integer; + states + start : initial state; + done : final state; + transitions + siblings : start -[]-> done { child_value := sibling_value }; + sibling_operands : start -[]-> done { base_value := child_value + sibling_value }; + changed_child : start -[]-> done { base_value := real_value }; + changed_parent : start -[]-> done { real_value := base_value }; + changed_operands : start -[]-> done { base_value := base_value + real_value }; + unknown_parent : start -[]-> done { opaque_value := numeric_value }; + unknown_child : start -[]-> done { opaque_value := any; numeric_value := opaque_value }; + extent : start -[]-> done { larger_array := any; base_array := larger_array }; + rank : start -[]-> done { matrix := any; base_array := matrix }; + integer_literal_left : start -[]-> done { child_value := 1 + sibling_value }; + integer_literal_right : start -[]-> done { child_value := sibling_value + 1 }; + real_literal_left : start -[]-> done { unrelated_real := 1.0 + real_value }; + real_literal_right : start -[]-> done { unrelated_real := real_value + 1.0 }; + boolean_literal_left : start -[]-> done { unrelated_flag := true and derived_flag }; + boolean_literal_right : start -[]-> done { unrelated_flag := derived_flag or false }; +**}; +end host.impl; +end IncompatibleExtensions; diff --git a/ba/org.osate.ba.tests/models/issue3261/Issue3261.aadl b/ba/org.osate.ba.tests/models/issue3261/Issue3261.aadl new file mode 100644 index 00000000000..b9721ab5ad7 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3261/Issue3261.aadl @@ -0,0 +1,58 @@ +-- Copyright (c) 2004-2026 Carnegie Mellon University and others. (see Contributors file). +-- All Rights Reserved. +-- +-- NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY +-- KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE +-- OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT +-- MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. +-- +-- This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 +-- which is available at https://www.eclipse.org/legal/epl-2.0/ +-- SPDX-License-Identifier: EPL-2.0 +-- +-- Created, in part, with funding and support from the United States Government. (see Acknowledgments file). +-- +-- This program includes and/or can make use of certain third party source code, object code, documentation and other +-- files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system +-- configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and +-- conditions contained in any such Third Party Software or separate license file distributed with such Third Party +-- Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party benefici- +-- aries to this license with respect to the terms applicable to their Third Party Software. Third Party Software li- +-- censes only apply to the Third Party Software and not any other portion of this program or this program as a whole. + +package Issue3261 +public +with Data_Model; + +data integer_type +properties + Data_Model::Data_Representation => Integer; +end integer_type; + +data child_integer extends integer_type +end child_integer; + +data grandchild_integer extends child_integer +end grandchild_integer; + +abstract host +end host; + +abstract implementation host.impl +annex behavior_specification {** + variables + base_value : integer_type := 1; + grandchild_value : grandchild_integer := 3; + states + start : initial state; + done : final state; + transitions + start -[]-> done { + base_value := grandchild_value; + grandchild_value := base_value; + base_value := base_value + grandchild_value; + base_value := grandchild_value + base_value + }; +**}; +end host.impl; +end Issue3261; diff --git a/ba/org.osate.ba.tests/models/issue3261/TypeExtensions.aadl b/ba/org.osate.ba.tests/models/issue3261/TypeExtensions.aadl new file mode 100644 index 00000000000..5b16c4443bc --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3261/TypeExtensions.aadl @@ -0,0 +1,171 @@ +-- Copyright (c) 2004-2026 Carnegie Mellon University and others. (see Contributors file). +-- All Rights Reserved. +-- +-- NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY +-- KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE +-- OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT +-- MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. +-- +-- This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 +-- which is available at https://www.eclipse.org/legal/epl-2.0/ +-- SPDX-License-Identifier: EPL-2.0 +-- +-- Created, in part, with funding and support from the United States Government. (see Acknowledgments file). +-- +-- This program includes and/or can make use of certain third party source code, object code, documentation and other +-- files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system +-- configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and +-- conditions contained in any such Third Party Software or separate license file distributed with such Third Party +-- Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party benefici- +-- aries to this license with respect to the terms applicable to their Third Party Software. Third Party Software li- +-- censes only apply to the Third Party Software and not any other portion of this program or this program as a whole. + +package TypeExtensions +public +with Data_Model; + +data integer_type +properties + Data_Model::Data_Representation => Integer; +end integer_type; + +data child_integer extends integer_type +end child_integer; + +data grandchild_integer extends child_integer +end grandchild_integer; + +data sibling_integer extends integer_type +end sibling_integer; + +data real_type +properties + Data_Model::Data_Representation => Float; +end real_type; + +data child_real extends real_type +end child_real; + +data boolean_type +properties + Data_Model::Data_Representation => Boolean; +end boolean_type; + +data child_boolean extends boolean_type +end child_boolean; + +data opaque +end opaque; + +data child_opaque extends opaque +end child_opaque; + +data implementation opaque.impl +end opaque.impl; + +data implementation opaque.extended extends opaque.impl +end opaque.extended; + +subprogram operation +features + argument : in parameter integer_type; + result : out parameter child_integer; + updated : in out parameter integer_type; +end operation; + +abstract host +features + input_base : in event data port integer_type; + input_child : in event data port child_integer; + output_base : out data port integer_type; + output_child : out data port child_integer; +end host; + +abstract implementation host.impl +internal features + raised_base : event data integer_type; + raised_child : event data child_integer; +annex behavior_specification {** + variables + base_value : integer_type := 1; + child_value : child_integer := 2; + grandchild_value : grandchild_integer := 3; + sibling_value : sibling_integer := 0; + base_real : real_type := 1.0; + derived_real : child_real := 2.0; + base_flag : boolean_type := true; + derived_flag : child_boolean := false; + base_object : opaque; + derived_object : child_opaque; + base_impl : opaque.impl; + derived_impl : opaque.extended; + base_array[2] : integer_type; + derived_array[2] : child_integer; + states + start : initial state; + done : final state; + transitions + assignments : start -[]-> done { + base_value := grandchild_value; + grandchild_value := base_value; + base_real := derived_real; + derived_real := base_real; + base_flag := derived_flag; + derived_flag := base_flag; + base_object := any; + derived_object := base_object; + base_object := derived_object; + base_impl := any; + derived_impl := base_impl; + base_impl := derived_impl + }; + -- A mixed expression has the base type in either operand order. Its value can then be assigned to a sibling. + expressions : start -[]-> done { + sibling_value := base_value + grandchild_value; + sibling_value := grandchild_value + base_value; + base_flag := base_value < child_value; + base_flag := child_value > base_value; + base_flag := base_flag and derived_flag; + base_flag := derived_flag or base_flag; + base_real := base_real + derived_real; + base_real := derived_real + base_real + }; + literal_operands : start -[]-> done { + base_value := grandchild_value + 1; + base_value := 1 + grandchild_value; + grandchild_value := base_value + 1; + grandchild_value := 1 + base_value; + sibling_value := (1 + grandchild_value) + base_value; + sibling_value := base_value + (grandchild_value + 1); + base_real := derived_real + 1.0; + base_real := 1.0 + derived_real; + derived_real := base_real + 1.0; + derived_real := 1.0 + base_real; + base_flag := derived_flag and true; + base_flag := false or derived_flag; + derived_flag := base_flag and true; + derived_flag := false or base_flag; + base_flag := (grandchild_value + 1 > base_value) and (derived_real + 1.0 > base_real) and true; + derived_flag := false or ((1 + base_value < grandchild_value) and (1.0 + base_real < derived_real)) + }; + communications : start -[]-> done { + output_base!(child_value); + output_child!(base_value); + input_base?(child_value); + input_child?(base_value); + raised_base!(child_value); + raised_child!(base_value); + operation!(child_value, base_value, child_value) + }; + arrays_and_ranges : start -[]-> done { + base_array := any; + derived_array := base_array; + base_array := derived_array; + for (element : child_integer in base_array) { child_value := element }; + for (element : integer_type in derived_array) { base_value := element }; + for (element : child_integer in base_value .. grandchild_value) { child_value := element }; + for (element : child_integer in grandchild_value .. base_value) { child_value := element } + }; +**}; +end host.impl; +end TypeExtensions; diff --git a/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3261Test.java b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3261Test.java new file mode 100644 index 00000000000..1f7dad8aefd --- /dev/null +++ b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3261Test.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) 2004-2026 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party benefici- + * aries to this license with respect to the terms applicable to their Third Party Software. Third Party Software li- + * censes only apply to the Third Party Software and not any other portion of this program or this program as a whole. + */ +package org.osate.ba.tests; + +import static org.junit.Assert.assertEquals; + +import java.util.Comparator; +import java.util.List; + +import org.eclipse.xtext.diagnostics.Severity; +import org.eclipse.xtext.nodemodel.util.NodeModelUtils; +import org.eclipse.xtext.testing.InjectWith; +import org.eclipse.xtext.testing.XtextRunner; +import org.eclipse.xtext.testing.validation.ValidationTestHelper; +import org.eclipse.xtext.validation.Issue; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.osate.aadl2.AadlPackage; +import org.osate.testsupport.TestHelper; + +import com.google.inject.Inject; +import com.itemis.xtext.testing.XtextTest; + +/** Exercises bidirectional classifier-extension compatibility through embedded BA validation. */ +@RunWith(XtextRunner.class) +@InjectWith(BehaviorAnnexInjectorProvider.class) +public class Issue3261Test extends XtextTest { + private static final String PATH = "org.osate.ba.tests/models/issue3261/"; + + @Inject + private TestHelper testHelper; + + @Inject + private ValidationTestHelper validationHelper; + + @Test + public void baseAndExtendedAssignmentsAndOperandsAreAccepted() throws Exception { + validationHelper.assertNoIssues(testHelper.parseFile(PATH + "Issue3261.aadl")); + } + + @Test + public void compatibleExtensionsWorkInBothDirections() throws Exception { + validationHelper.assertNoIssues(testHelper.parseFile(PATH + "TypeExtensions.aadl")); + } + + @Test + public void extensionsAndLiteralsPreserveTypeAndShapeRestrictions() throws Exception { + assertDiagnostics("IncompatibleExtensions", List.of( + new Expected("sibling_value", + "type error for 'assignment', 'IncompatibleExtensions::child_integer' expected, found 'IncompatibleExtensions::sibling_integer'."), + new Expected("child_value + sibling_value", + "Invalid operand types for operator \"+\": left operand has type IncompatibleExtensions::child_integer, right operand has type IncompatibleExtensions::sibling_integer"), + new Expected("real_value", + "type error for 'assignment', 'IncompatibleExtensions::integer_type' expected, found 'IncompatibleExtensions::changed_representation'."), + new Expected("base_value", + "type error for 'assignment', 'IncompatibleExtensions::changed_representation' expected, found 'IncompatibleExtensions::integer_type'."), + new Expected("base_value + real_value", + "Invalid operand types for operator \"+\": left operand has type IncompatibleExtensions::integer_type, right operand has type IncompatibleExtensions::changed_representation"), + new Expected("numeric_value", + "type error for 'assignment', 'IncompatibleExtensions::opaque' expected, found 'IncompatibleExtensions::numeric_opaque'."), + new Expected("opaque_value", + "type error for 'assignment', 'IncompatibleExtensions::numeric_opaque' expected, found 'IncompatibleExtensions::opaque'."), + new Expected("larger_array", + "type error for 'assignment', 'IncompatibleExtensions::integer_type[2]' expected, found 'IncompatibleExtensions::child_integer[3]'."), + new Expected("matrix", + "type error for 'assignment', 'IncompatibleExtensions::integer_type[2]' expected, found 'IncompatibleExtensions::child_integer[2][2]'."), + new Expected("1 + sibling_value", + "type error for 'assignment', 'IncompatibleExtensions::child_integer' expected, found 'IncompatibleExtensions::sibling_integer'."), + new Expected("sibling_value + 1", + "type error for 'assignment', 'IncompatibleExtensions::child_integer' expected, found 'IncompatibleExtensions::sibling_integer'."), + new Expected("1.0 + real_value", + "type error for 'assignment', 'IncompatibleExtensions::real_type' expected, found 'IncompatibleExtensions::changed_representation'."), + new Expected("real_value + 1.0", + "type error for 'assignment', 'IncompatibleExtensions::real_type' expected, found 'IncompatibleExtensions::changed_representation'."), + new Expected("true and derived_flag", + "type error for 'assignment', 'IncompatibleExtensions::unrelated_boolean' expected, found 'IncompatibleExtensions::child_boolean'."), + new Expected("derived_flag or false", + "type error for 'assignment', 'IncompatibleExtensions::unrelated_boolean' expected, found 'IncompatibleExtensions::child_boolean'."))); + } + + private void assertDiagnostics(String model, List expected) throws Exception { + var root = testHelper.parseFile(PATH + model + ".aadl"); + var source = NodeModelUtils.getNode(root).getRootNode().getText(); + var issues = validationHelper.validate(root).stream().sorted(Comparator.comparing(Issue::getOffset)).toList(); + assertEquals(issues.toString(), expected.size(), issues.size()); + assertEquals(expected, issues.stream().map(issue -> { + assertEquals(Severity.ERROR, issue.getSeverity()); + return new Expected(source.substring(issue.getOffset(), issue.getOffset() + issue.getLength()), + issue.getMessage()); + }).toList()); + } + + private record Expected(String target, String message) { + } +} From ab68a1ca600223a8521fe909d3fbc7a39a35a648 Mon Sep 17 00:00:00 2001 From: Lutz Wrage Date: Fri, 18 Sep 2026 15:54:19 -0400 Subject: [PATCH 2/2] Allow compatible BA classifier extensions 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. --- ba/doc/conformance.md | 4 +- ba/doc/properties.md | 2 +- ...ts_models_issue3199_ClassifierIdentity.txt | 1 - ...odels_issue3261_IncompatibleExtensions.txt | 15 + ...te.ba.tests_models_issue3261_Issue3261.txt | 0 ....tests_models_issue3261_TypeExtensions.txt | 0 ...odels_issue3261_IncompatibleExtensions.txt | 0 ...te.ba.tests_models_issue3261_Issue3261.txt | 0 ....tests_models_issue3261_TypeExtensions.txt | 0 ...odels_issue3261_IncompatibleExtensions.txt | 197 ++++++ ...te.ba.tests_models_issue3261_Issue3261.txt | 47 ++ ....tests_models_issue3261_TypeExtensions.txt | 493 ++++++++++++++ ...odels_issue3261_IncompatibleExtensions.txt | 226 +++++++ ...te.ba.tests_models_issue3261_Issue3261.txt | 49 ++ ....tests_models_issue3261_TypeExtensions.txt | 609 ++++++++++++++++++ ...odels_issue3261_IncompatibleExtensions.txt | 35 + ...te.ba.tests_models_issue3261_Issue3261.txt | 17 + ....tests_models_issue3261_TypeExtensions.txt | 84 +++ .../src/org/osate/ba/tests/Issue3199Test.java | 4 +- .../ba/analyzers/AdaLikeDataTypeChecker.java | 20 +- 20 files changed, 1793 insertions(+), 10 deletions(-) create mode 100644 ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3261_Issue3261.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3261_TypeExtensions.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3261_Issue3261.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3261_TypeExtensions.txt create mode 100644 ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt create mode 100644 ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3261_Issue3261.txt create mode 100644 ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3261_TypeExtensions.txt create mode 100644 ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt create mode 100644 ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3261_Issue3261.txt create mode 100644 ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3261_TypeExtensions.txt create mode 100644 ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt create mode 100644 ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3261_Issue3261.txt create mode 100644 ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3261_TypeExtensions.txt diff --git a/ba/doc/conformance.md b/ba/doc/conformance.md index 826f57c67e9..ec353d47d2b 100644 --- a/ba/doc/conformance.md +++ b/ba/doc/conformance.md @@ -180,9 +180,9 @@ Signatures include every feature, including ports, in source declaration order. **Addressed by [#3199](https://github.com/osate/osate2/issues/3199):** `AdaLikeDataTypeChecker.conformsTo` now checks assignment, send, dequeue, call-parameter, iterator, and binary-operand type compatibility. Declaration initializers use the same relation. `Issue3199Test` exercises these paths through external AADL models and the registered BA validator; its original four-transition reproduction reports one error per transition. -**Standard and tool policy:** D.6 explicitly requires assignment types and subprogram signatures to match; communication actions include implicit assignments through the D.5 service equivalences. D.5 itself has no legality rules. D.7 restricts operator applicability and derives the expression language from Ada95. Annex D does not define classifier substitutability. OSATE therefore uses case-insensitive qualified-name equality for classifier-typed operands, including classifiers with unknown representation. This deliberately rejects extension and type/implementation pairs. Integer literals match integer representations, while universal real literals match floating and fixed-point representations; classifier-typed numerics do not widen implicitly. +**Standard and tool policy:** D.6 explicitly requires assignment types and subprogram signatures to match; communication actions include implicit assignments through the D.5 service equivalences. D.5 itself has no legality rules. D.7 restricts operator applicability and derives the expression language from Ada95. Annex D does not define classifier substitutability. The follow-up [#3261](https://github.com/osate/osate2/issues/3261) accepts classifier-typed operands with the same case-insensitive qualified name, or with an ancestor/descendant extension relationship and the same data representation. Extension compatibility works in both directions and includes transitive type and implementation extensions. Sibling classifiers and type/implementation realization pairs remain distinct. Two related classifiers with unspecified representation are compatible, but an extension that changes an unspecified representation to a known one is not treated as equivalent. Integer literals match integer representations, while universal real literals match floating and fixed-point representations; classifier-typed numerics do not widen implicitly. -Array rank must agree when known, and each extent is compared only when both extents are statically known. Symbolic extents remain unknown. Expression results preserve their selected classifier, representation, and dimensions. Untyped features and unresolved classifier references do not establish a type mismatch; linking diagnostics retain responsibility for unresolved names. +Array rank must agree when known, and each extent is compared only when both extents are statically known. Symbolic extents remain unknown. Expression results preserve their selected classifier, representation, and dimensions. A mixed base/extension expression selects the base classifier independently of operand order. `Issue3261Test` covers bidirectional assignments, arithmetic and logical operands (including integer, real, and Boolean literals on either side), comparisons, port sends/dequeues, internal sends, call parameters, arrays, and iteration, while preserving representation and array-shape restrictions. Untyped features and unresolved classifier references do not establish a type mismatch; linking diagnostics retain responsibility for unresolved names. **Corpus triage:** the grammar characterization fixture now consistently uses its custom integer classifier. Standard example 7 uses Boolean status literals and matching data implementation classifiers at its calls; comments record the corrections to the published example and the nominal type policy. The existing internal-port negative fixture now asserts its two formerly suppressed type errors. Type errors no longer suppress initialization and legality checking; unresolved holders, variable classifiers, and property associations still stop strict-model checks. The nested-array regression from #3226 remains accepted: an iterator retains its own declared classifier, and the array extent is read from the array classifier rather than its element classifier. diff --git a/ba/doc/properties.md b/ba/doc/properties.md index 952f806ca19..e2f98c6a334 100644 --- a/ba/doc/properties.md +++ b/ba/doc/properties.md @@ -19,7 +19,7 @@ This review covers the 19 issues carrying the `ba` label that were open on Septe | [#2669 — action blocks not fully typechecked](https://github.com/osate/osate2/issues/2669) | The reproduction determines the port's enum type from `Data_Representation` and `Enumerators`, both property values that may be overridden on a feature instance. | | [#3173 — omitted loop classifier](https://github.com/osate/osate2/issues/3173) | Grammar acceptance and integer-range inference are declarative. Inference from ports or arrays uses effective `Data_Representation`, `Base_Type`, and `Dimension` values and resolved prototype actuals, so that portion is instance-specific. | | [#3181 — communication and call signatures](https://github.com/osate/osate2/issues/3181) | Target category, parameter count and order, and direction are structural. Actual/formal type compatibility becomes instance-specific wherever it uses Data Model representation, array, range, or feature properties. | -| [#3199 — declared type conformance](https://github.com/osate/osate2/issues/3199) | The source fix checks classifier identity, literal compatibility, and statically declared Data Model properties. It does not establish conformance after contained overrides or effective prototype bindings. Those checks, including instance-specific operator applicability, arrays, ranges, and property-reference values, remain [#3229](https://github.com/osate/osate2/issues/3229). | +| [#3199 — declared type conformance](https://github.com/osate/osate2/issues/3199) | The source fix checks classifier identity and [extension compatibility (#3261)](https://github.com/osate/osate2/issues/3261), literal compatibility, and statically declared Data Model properties. It does not establish conformance after contained overrides or effective prototype bindings. Those checks, including instance-specific operator applicability, arrays, ranges, and property-reference values, remain [#3229](https://github.com/osate/osate2/issues/3229). | ## Issues not inherently affected diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_ClassifierIdentity.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_ClassifierIdentity.txt index d57a8d85790..95b6a98e10e 100644 --- a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_ClassifierIdentity.txt +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_ClassifierIdentity.txt @@ -1,5 +1,4 @@ error | semantic | 64 | 65 | 6 | type error for 'assignment', 'ClassifierIdentity::first_type' expected, found 'ClassifierIdentity::second_type'. -error | semantic | 65 | 58 | 5 | type error for 'assignment', 'ClassifierIdentity::first_type' expected, found 'ClassifierIdentity::child_type'. error | semantic | 66 | 77 | 14 | type error for 'assignment', 'ClassifierIdentity::first_type' expected, found 'ClassifierIdentity::first_type.impl'. error | semantic | 68 | 52 | 20 | type error for 'assignment', 'ClassifierIdentity::first_boolean' expected, found 'ClassifierIdentity::second_boolean'. error | semantic | 69 | 53 | 20 | type error for 'assignment', 'ClassifierIdentity::first_boolean' expected, found 'ClassifierIdentity::second_boolean'. diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt new file mode 100644 index 00000000000..f913c52636b --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt @@ -0,0 +1,15 @@ +error | semantic | 100 | 61 | 17 | type error for 'assignment', 'IncompatibleExtensions::child_integer' expected, found 'IncompatibleExtensions::sibling_integer'. +error | semantic | 101 | 60 | 16 | type error for 'assignment', 'IncompatibleExtensions::real_type' expected, found 'IncompatibleExtensions::changed_representation'. +error | semantic | 102 | 61 | 16 | type error for 'assignment', 'IncompatibleExtensions::real_type' expected, found 'IncompatibleExtensions::changed_representation'. +error | semantic | 103 | 63 | 21 | type error for 'assignment', 'IncompatibleExtensions::unrelated_boolean' expected, found 'IncompatibleExtensions::child_boolean'. +error | semantic | 104 | 64 | 21 | type error for 'assignment', 'IncompatibleExtensions::unrelated_boolean' expected, found 'IncompatibleExtensions::child_boolean'. +error | semantic | 90 | 48 | 13 | type error for 'assignment', 'IncompatibleExtensions::child_integer' expected, found 'IncompatibleExtensions::sibling_integer'. +error | semantic | 91 | 55 | 27 | Invalid operand types for operator "+": left operand has type IncompatibleExtensions::child_integer, right operand has type IncompatibleExtensions::sibling_integer +error | semantic | 92 | 52 | 10 | type error for 'assignment', 'IncompatibleExtensions::integer_type' expected, found 'IncompatibleExtensions::changed_representation'. +error | semantic | 93 | 53 | 10 | type error for 'assignment', 'IncompatibleExtensions::changed_representation' expected, found 'IncompatibleExtensions::integer_type'. +error | semantic | 94 | 55 | 23 | Invalid operand types for operator "+": left operand has type IncompatibleExtensions::integer_type, right operand has type IncompatibleExtensions::changed_representation +error | semantic | 95 | 55 | 13 | type error for 'assignment', 'IncompatibleExtensions::opaque' expected, found 'IncompatibleExtensions::numeric_opaque'. +error | semantic | 96 | 76 | 12 | type error for 'assignment', 'IncompatibleExtensions::numeric_opaque' expected, found 'IncompatibleExtensions::opaque'. +error | semantic | 97 | 66 | 12 | type error for 'assignment', 'IncompatibleExtensions::integer_type[2]' expected, found 'IncompatibleExtensions::child_integer[3]'. +error | semantic | 98 | 58 | 6 | type error for 'assignment', 'IncompatibleExtensions::integer_type[2]' expected, found 'IncompatibleExtensions::child_integer[2][2]'. +error | semantic | 99 | 60 | 17 | type error for 'assignment', 'IncompatibleExtensions::child_integer' expected, found 'IncompatibleExtensions::sibling_integer'. diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3261_Issue3261.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3261_Issue3261.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3261_TypeExtensions.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3261_TypeExtensions.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3261_Issue3261.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3261_Issue3261.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3261_TypeExtensions.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3261_TypeExtensions.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt new file mode 100644 index 00000000000..5c496b8a240 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt @@ -0,0 +1,197 @@ +annex[0] owner=IncompatibleExtensions::host.impl + (ArrayDimension, , 3083, 3) + (ArrayDimension, , 3117, 3) + (ArrayDimension, , 3128, 3) + (ArrayDimension, , 3131, 3) + (AssignmentAction, , 3252, 28) + (AssignmentAction, , 3324, 41) + (AssignmentAction, , 3406, 24) + (AssignmentAction, , 3472, 24) + (AssignmentAction, , 3540, 37) + (AssignmentAction, , 3619, 29) + (AssignmentAction, , 3689, 19) + (AssignmentAction, , 3710, 29) + (AssignmentAction, , 3773, 19) + (AssignmentAction, , 3794, 26) + (AssignmentAction, , 3852, 13) + (AssignmentAction, , 3867, 20) + (AssignmentAction, , 3935, 32) + (AssignmentAction, , 4016, 32) + (AssignmentAction, , 4093, 34) + (AssignmentAction, , 4173, 34) + (AssignmentAction, , 4255, 39) + (AssignmentAction, , 4343, 39) + (BehaviorActionBlock, , 3250, 32) + (BehaviorActionBlock, , 3322, 45) + (BehaviorActionBlock, , 3404, 28) + (BehaviorActionBlock, , 3470, 28) + (BehaviorActionBlock, , 3538, 41) + (BehaviorActionBlock, , 3617, 33) + (BehaviorActionBlock, , 3687, 54) + (BehaviorActionBlock, , 3771, 51) + (BehaviorActionBlock, , 3850, 39) + (BehaviorActionBlock, , 3933, 36) + (BehaviorActionBlock, , 4014, 36) + (BehaviorActionBlock, , 4091, 38) + (BehaviorActionBlock, , 4171, 38) + (BehaviorActionBlock, , 4253, 43) + (BehaviorActionBlock, , 4341, 43) + (BehaviorActionSequence, , 3689, 50) + (BehaviorActionSequence, , 3773, 47) + (BehaviorActionSequence, , 3852, 35) + (BehaviorAnnex, behavior_specification, 2717, 1668) + (BehaviorBooleanLiteral, , 3018, 4) + (BehaviorBooleanLiteral, , 3064, 5) + (BehaviorBooleanLiteral, , 4273, 4) + (BehaviorBooleanLiteral, , 4377, 5) + (BehaviorIntegerLiteral, , 2758, 1) + (BehaviorIntegerLiteral, , 2794, 1) + (BehaviorIntegerLiteral, , 2834, 1) + (BehaviorIntegerLiteral, , 2944, 1) + (BehaviorIntegerLiteral, , 3084, 1) + (BehaviorIntegerLiteral, , 3118, 1) + (BehaviorIntegerLiteral, , 3129, 1) + (BehaviorIntegerLiteral, , 3132, 1) + (BehaviorIntegerLiteral, , 3950, 1) + (BehaviorIntegerLiteral, , 4047, 1) + (BehaviorRealLiteral, , 2878, 3) + (BehaviorRealLiteral, , 2979, 3) + (BehaviorRealLiteral, , 4111, 3) + (BehaviorRealLiteral, , 4204, 3) + (BehaviorState, done, 3187, 4) + (BehaviorState, start, 3162, 5) + (BehaviorStateGroup, , 3162, 22) + (BehaviorStateGroup, , 3187, 19) + (BehaviorTransition, boolean_literal_left, 4213, 84) + (BehaviorTransition, boolean_literal_right, 4300, 85) + (BehaviorTransition, changed_child, 3371, 62) + (BehaviorTransition, changed_operands, 3502, 78) + (BehaviorTransition, changed_parent, 3436, 63) + (BehaviorTransition, extent, 3745, 78) + (BehaviorTransition, integer_literal_left, 3893, 77) + (BehaviorTransition, integer_literal_right, 3973, 78) + (BehaviorTransition, rank, 3826, 64) + (BehaviorTransition, real_literal_left, 4054, 76) + (BehaviorTransition, real_literal_right, 4133, 77) + (BehaviorTransition, sibling_operands, 3286, 82) + (BehaviorTransition, siblings, 3222, 61) + (BehaviorTransition, unknown_child, 3654, 88) + (BehaviorTransition, unknown_parent, 3583, 68) + (BehaviorVariable, base_array, 3073, 13) + (BehaviorVariable, base_value, 2729, 10) + (BehaviorVariable, child_value, 2763, 11) + (BehaviorVariable, derived_flag, 2986, 12) + (BehaviorVariable, larger_array, 3105, 15) + (BehaviorVariable, matrix, 3122, 12) + (BehaviorVariable, numeric_value, 2910, 13) + (BehaviorVariable, opaque_value, 2885, 12) + (BehaviorVariable, real_value, 2839, 10) + (BehaviorVariable, sibling_value, 2799, 13) + (BehaviorVariable, unrelated_flag, 3026, 14) + (BehaviorVariable, unrelated_real, 2949, 14) + (BehaviorVariableGroup, , 2729, 31) + (BehaviorVariableGroup, , 2763, 33) + (BehaviorVariableGroup, , 2799, 37) + (BehaviorVariableGroup, , 2839, 43) + (BehaviorVariableGroup, , 2885, 22) + (BehaviorVariableGroup, , 2910, 36) + (BehaviorVariableGroup, , 2949, 34) + (BehaviorVariableGroup, , 2986, 37) + (BehaviorVariableGroup, , 3026, 44) + (BehaviorVariableGroup, , 3073, 29) + (BehaviorVariableGroup, , 3105, 46) + (BinaryExpression, , 3338, 27) + (BinaryExpression, , 3554, 23) + (BinaryExpression, , 3950, 17) + (BinaryExpression, , 4031, 17) + (BinaryExpression, , 4111, 16) + (BinaryExpression, , 4191, 16) + (BinaryExpression, , 4273, 21) + (BinaryExpression, , 4361, 21) + (Reference, , 3252, 11) + (Reference, , 3267, 13) + (Reference, , 3324, 10) + (Reference, , 3338, 11) + (Reference, , 3352, 13) + (Reference, , 3406, 10) + (Reference, , 3420, 10) + (Reference, , 3472, 10) + (Reference, , 3486, 10) + (Reference, , 3540, 10) + (Reference, , 3554, 10) + (Reference, , 3567, 10) + (Reference, , 3619, 12) + (Reference, , 3635, 13) + (Reference, , 3689, 12) + (Reference, , 3710, 13) + (Reference, , 3727, 12) + (Reference, , 3773, 12) + (Reference, , 3794, 10) + (Reference, , 3808, 12) + (Reference, , 3852, 6) + (Reference, , 3867, 10) + (Reference, , 3881, 6) + (Reference, , 3935, 11) + (Reference, , 3954, 13) + (Reference, , 4016, 11) + (Reference, , 4031, 13) + (Reference, , 4093, 14) + (Reference, , 4117, 10) + (Reference, , 4173, 14) + (Reference, , 4191, 10) + (Reference, , 4255, 14) + (Reference, , 4282, 12) + (Reference, , 4343, 14) + (Reference, , 4361, 12) + (ReferenceExpression, , 3267, 13) + (ReferenceExpression, , 3338, 11) + (ReferenceExpression, , 3352, 13) + (ReferenceExpression, , 3420, 10) + (ReferenceExpression, , 3486, 10) + (ReferenceExpression, , 3554, 10) + (ReferenceExpression, , 3567, 10) + (ReferenceExpression, , 3635, 13) + (ReferenceExpression, , 3727, 12) + (ReferenceExpression, , 3808, 12) + (ReferenceExpression, , 3881, 6) + (ReferenceExpression, , 3954, 13) + (ReferenceExpression, , 4031, 13) + (ReferenceExpression, , 4117, 10) + (ReferenceExpression, , 4191, 10) + (ReferenceExpression, , 4282, 12) + (ReferenceExpression, , 4361, 12) + (ReferenceSegment, base_array, 3794, 10) + (ReferenceSegment, base_array, 3867, 10) + (ReferenceSegment, base_value, 3324, 10) + (ReferenceSegment, base_value, 3406, 10) + (ReferenceSegment, base_value, 3486, 10) + (ReferenceSegment, base_value, 3540, 10) + (ReferenceSegment, base_value, 3554, 10) + (ReferenceSegment, child_value, 3252, 11) + (ReferenceSegment, child_value, 3338, 11) + (ReferenceSegment, child_value, 3935, 11) + (ReferenceSegment, child_value, 4016, 11) + (ReferenceSegment, derived_flag, 4282, 12) + (ReferenceSegment, derived_flag, 4361, 12) + (ReferenceSegment, larger_array, 3773, 12) + (ReferenceSegment, larger_array, 3808, 12) + (ReferenceSegment, matrix, 3852, 6) + (ReferenceSegment, matrix, 3881, 6) + (ReferenceSegment, numeric_value, 3635, 13) + (ReferenceSegment, numeric_value, 3710, 13) + (ReferenceSegment, opaque_value, 3619, 12) + (ReferenceSegment, opaque_value, 3689, 12) + (ReferenceSegment, opaque_value, 3727, 12) + (ReferenceSegment, real_value, 3420, 10) + (ReferenceSegment, real_value, 3472, 10) + (ReferenceSegment, real_value, 3567, 10) + (ReferenceSegment, real_value, 4117, 10) + (ReferenceSegment, real_value, 4191, 10) + (ReferenceSegment, sibling_value, 3267, 13) + (ReferenceSegment, sibling_value, 3352, 13) + (ReferenceSegment, sibling_value, 3954, 13) + (ReferenceSegment, sibling_value, 4031, 13) + (ReferenceSegment, unrelated_flag, 4255, 14) + (ReferenceSegment, unrelated_flag, 4343, 14) + (ReferenceSegment, unrelated_real, 4093, 14) + (ReferenceSegment, unrelated_real, 4173, 14) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3261_Issue3261.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3261_Issue3261.txt new file mode 100644 index 00000000000..d2831e7bd4f --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3261_Issue3261.txt @@ -0,0 +1,47 @@ +annex[0] owner=Issue3261::host.impl + (AssignmentAction, , 2300, 30) + (AssignmentAction, , 2338, 30) + (AssignmentAction, , 2376, 43) + (AssignmentAction, , 2427, 43) + (BehaviorActionBlock, , 2292, 184) + (BehaviorActionSequence, , 2300, 170) + (BehaviorAnnex, behavior_specification, 2103, 374) + (BehaviorIntegerLiteral, , 2146, 1) + (BehaviorIntegerLiteral, , 2194, 1) + (BehaviorState, done, 2237, 4) + (BehaviorState, start, 2210, 5) + (BehaviorStateGroup, , 2210, 22) + (BehaviorStateGroup, , 2237, 19) + (BehaviorTransition, , 2275, 202) + (BehaviorVariable, base_value, 2117, 10) + (BehaviorVariable, grandchild_value, 2153, 16) + (BehaviorVariableGroup, , 2117, 31) + (BehaviorVariableGroup, , 2153, 43) + (BinaryExpression, , 2390, 29) + (BinaryExpression, , 2441, 29) + (Reference, , 2300, 10) + (Reference, , 2314, 16) + (Reference, , 2338, 16) + (Reference, , 2358, 10) + (Reference, , 2376, 10) + (Reference, , 2390, 10) + (Reference, , 2403, 16) + (Reference, , 2427, 10) + (Reference, , 2441, 16) + (Reference, , 2460, 10) + (ReferenceExpression, , 2314, 16) + (ReferenceExpression, , 2358, 10) + (ReferenceExpression, , 2390, 10) + (ReferenceExpression, , 2403, 16) + (ReferenceExpression, , 2441, 16) + (ReferenceExpression, , 2460, 10) + (ReferenceSegment, base_value, 2300, 10) + (ReferenceSegment, base_value, 2358, 10) + (ReferenceSegment, base_value, 2376, 10) + (ReferenceSegment, base_value, 2390, 10) + (ReferenceSegment, base_value, 2427, 10) + (ReferenceSegment, base_value, 2460, 10) + (ReferenceSegment, grandchild_value, 2314, 16) + (ReferenceSegment, grandchild_value, 2338, 16) + (ReferenceSegment, grandchild_value, 2403, 16) + (ReferenceSegment, grandchild_value, 2441, 16) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3261_TypeExtensions.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3261_TypeExtensions.txt new file mode 100644 index 00000000000..a423d173e2d --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3261_TypeExtensions.txt @@ -0,0 +1,493 @@ +annex[0] owner=TypeExtensions::host.impl + (ArrayDimension, , 3564, 3) + (ArrayDimension, , 3599, 3) + (AssignmentAction, , 3726, 30) + (AssignmentAction, , 3761, 30) + (AssignmentAction, , 3796, 25) + (AssignmentAction, , 3826, 25) + (AssignmentAction, , 3856, 25) + (AssignmentAction, , 3886, 25) + (AssignmentAction, , 3916, 18) + (AssignmentAction, , 3939, 29) + (AssignmentAction, , 3973, 29) + (AssignmentAction, , 4007, 16) + (AssignmentAction, , 4028, 25) + (AssignmentAction, , 4058, 25) + (AssignmentAction, , 4239, 46) + (AssignmentAction, , 4290, 46) + (AssignmentAction, , 4341, 37) + (AssignmentAction, , 4383, 37) + (AssignmentAction, , 4425, 39) + (AssignmentAction, , 4469, 38) + (AssignmentAction, , 4512, 37) + (AssignmentAction, , 4554, 37) + (AssignmentAction, , 4640, 34) + (AssignmentAction, , 4679, 34) + (AssignmentAction, , 4718, 34) + (AssignmentAction, , 4757, 34) + (AssignmentAction, , 4796, 52) + (AssignmentAction, , 4853, 52) + (AssignmentAction, , 4910, 31) + (AssignmentAction, , 4946, 31) + (AssignmentAction, , 4982, 31) + (AssignmentAction, , 5018, 31) + (AssignmentAction, , 5054, 34) + (AssignmentAction, , 5093, 34) + (AssignmentAction, , 5132, 34) + (AssignmentAction, , 5171, 34) + (AssignmentAction, , 5210, 94) + (AssignmentAction, , 5309, 99) + (AssignmentAction, , 5731, 17) + (AssignmentAction, , 5753, 27) + (AssignmentAction, , 5785, 27) + (AssignmentAction, , 5863, 22) + (AssignmentAction, , 5940, 21) + (AssignmentAction, , 6034, 22) + (AssignmentAction, , 6129, 22) + (BehaviorActionBlock, , 3721, 366) + (BehaviorActionBlock, , 4234, 361) + (BehaviorActionBlock, , 4635, 777) + (BehaviorActionBlock, , 5450, 235) + (BehaviorActionBlock, , 5726, 431) + (BehaviorActionSequence, , 3726, 357) + (BehaviorActionSequence, , 4239, 352) + (BehaviorActionSequence, , 4640, 768) + (BehaviorActionSequence, , 5455, 226) + (BehaviorActionSequence, , 5731, 422) + (BehaviorAnnex, behavior_specification, 3123, 3035) + (BehaviorBooleanLiteral, , 3387, 4) + (BehaviorBooleanLiteral, , 3427, 5) + (BehaviorBooleanLiteral, , 5084, 4) + (BehaviorBooleanLiteral, , 5106, 5) + (BehaviorBooleanLiteral, , 5162, 4) + (BehaviorBooleanLiteral, , 5187, 5) + (BehaviorBooleanLiteral, , 5300, 4) + (BehaviorBooleanLiteral, , 5325, 5) + (BehaviorIntegerLiteral, , 3164, 1) + (BehaviorIntegerLiteral, , 3200, 1) + (BehaviorIntegerLiteral, , 3246, 1) + (BehaviorIntegerLiteral, , 3286, 1) + (BehaviorIntegerLiteral, , 3565, 1) + (BehaviorIntegerLiteral, , 3600, 1) + (BehaviorIntegerLiteral, , 4673, 1) + (BehaviorIntegerLiteral, , 4693, 1) + (BehaviorIntegerLiteral, , 4751, 1) + (BehaviorIntegerLiteral, , 4777, 1) + (BehaviorIntegerLiteral, , 4814, 1) + (BehaviorIntegerLiteral, , 4903, 1) + (BehaviorIntegerLiteral, , 5243, 1) + (BehaviorIntegerLiteral, , 5336, 1) + (BehaviorRealLiteral, , 3316, 3) + (BehaviorRealLiteral, , 3352, 3) + (BehaviorRealLiteral, , 4938, 3) + (BehaviorRealLiteral, , 4959, 3) + (BehaviorRealLiteral, , 5010, 3) + (BehaviorRealLiteral, , 5034, 3) + (BehaviorRealLiteral, , 5279, 3) + (BehaviorRealLiteral, , 5376, 3) + (BehaviorState, done, 3655, 4) + (BehaviorState, start, 3630, 5) + (BehaviorStateGroup, , 3630, 22) + (BehaviorStateGroup, , 3655, 19) + (BehaviorTransition, arrays_and_ranges, 5689, 469) + (BehaviorTransition, assignments, 3690, 398) + (BehaviorTransition, communications, 5416, 270) + (BehaviorTransition, expressions, 4203, 393) + (BehaviorTransition, literal_operands, 4599, 814) + (BehaviorVariable, base_array, 3554, 13) + (BehaviorVariable, base_flag, 3359, 9) + (BehaviorVariable, base_impl, 3493, 9) + (BehaviorVariable, base_object, 3436, 11) + (BehaviorVariable, base_real, 3291, 9) + (BehaviorVariable, base_value, 3135, 10) + (BehaviorVariable, child_value, 3169, 11) + (BehaviorVariable, derived_array, 3586, 16) + (BehaviorVariable, derived_flag, 3395, 12) + (BehaviorVariable, derived_impl, 3520, 12) + (BehaviorVariable, derived_object, 3460, 14) + (BehaviorVariable, derived_real, 3323, 12) + (BehaviorVariable, grandchild_value, 3205, 16) + (BehaviorVariable, sibling_value, 3251, 13) + (BehaviorVariableGroup, , 3135, 31) + (BehaviorVariableGroup, , 3169, 33) + (BehaviorVariableGroup, , 3205, 43) + (BehaviorVariableGroup, , 3251, 37) + (BehaviorVariableGroup, , 3291, 29) + (BehaviorVariableGroup, , 3323, 33) + (BehaviorVariableGroup, , 3359, 33) + (BehaviorVariableGroup, , 3395, 38) + (BehaviorVariableGroup, , 3436, 21) + (BehaviorVariableGroup, , 3460, 30) + (BehaviorVariableGroup, , 3493, 24) + (BehaviorVariableGroup, , 3520, 31) + (BehaviorVariableGroup, , 3554, 29) + (BehaviorVariableGroup, , 3586, 33) + (BinaryExpression, , 4256, 29) + (BinaryExpression, , 4307, 29) + (BinaryExpression, , 4354, 24) + (BinaryExpression, , 4396, 24) + (BinaryExpression, , 4438, 26) + (BinaryExpression, , 4482, 25) + (BinaryExpression, , 4525, 24) + (BinaryExpression, , 4567, 24) + (BinaryExpression, , 4654, 20) + (BinaryExpression, , 4693, 20) + (BinaryExpression, , 4738, 14) + (BinaryExpression, , 4777, 14) + (BinaryExpression, , 4813, 35) + (BinaryExpression, , 4814, 20) + (BinaryExpression, , 4870, 35) + (BinaryExpression, , 4884, 20) + (BinaryExpression, , 4923, 18) + (BinaryExpression, , 4959, 18) + (BinaryExpression, , 4998, 15) + (BinaryExpression, , 5034, 15) + (BinaryExpression, , 5067, 21) + (BinaryExpression, , 5106, 21) + (BinaryExpression, , 5148, 18) + (BinaryExpression, , 5187, 18) + (BinaryExpression, , 5223, 72) + (BinaryExpression, , 5223, 81) + (BinaryExpression, , 5224, 20) + (BinaryExpression, , 5224, 33) + (BinaryExpression, , 5264, 18) + (BinaryExpression, , 5264, 30) + (BinaryExpression, , 5325, 83) + (BinaryExpression, , 5335, 72) + (BinaryExpression, , 5336, 14) + (BinaryExpression, , 5336, 33) + (BinaryExpression, , 5376, 15) + (BinaryExpression, , 5376, 30) + (CommunicationAction, , 5455, 25) + (CommunicationAction, , 5485, 25) + (CommunicationAction, , 5515, 24) + (CommunicationAction, , 5544, 24) + (CommunicationAction, , 5573, 25) + (CommunicationAction, , 5603, 25) + (CommunicationAction, , 5633, 48) + (ElementValues, , 5849, 10) + (ElementValues, , 5923, 13) + (ElementValues, , 6000, 30) + (ElementValues, , 6095, 30) + (ForStatement, , 5817, 70) + (ForStatement, , 5892, 71) + (ForStatement, , 5968, 90) + (ForStatement, , 6063, 90) + (ParenthesizedExpression, , 4813, 22) + (ParenthesizedExpression, , 4883, 22) + (ParenthesizedExpression, , 5223, 35) + (ParenthesizedExpression, , 5263, 32) + (ParenthesizedExpression, , 5334, 74) + (ParenthesizedExpression, , 5335, 35) + (ParenthesizedExpression, , 5375, 32) + (Reference, , 3726, 10) + (Reference, , 3740, 16) + (Reference, , 3761, 16) + (Reference, , 3781, 10) + (Reference, , 3796, 9) + (Reference, , 3809, 12) + (Reference, , 3826, 12) + (Reference, , 3842, 9) + (Reference, , 3856, 9) + (Reference, , 3869, 12) + (Reference, , 3886, 12) + (Reference, , 3902, 9) + (Reference, , 3916, 11) + (Reference, , 3939, 14) + (Reference, , 3957, 11) + (Reference, , 3973, 11) + (Reference, , 3988, 14) + (Reference, , 4007, 9) + (Reference, , 4028, 12) + (Reference, , 4044, 9) + (Reference, , 4058, 9) + (Reference, , 4071, 12) + (Reference, , 4239, 13) + (Reference, , 4256, 10) + (Reference, , 4269, 16) + (Reference, , 4290, 13) + (Reference, , 4307, 16) + (Reference, , 4326, 10) + (Reference, , 4341, 9) + (Reference, , 4354, 10) + (Reference, , 4367, 11) + (Reference, , 4383, 9) + (Reference, , 4396, 11) + (Reference, , 4410, 10) + (Reference, , 4425, 9) + (Reference, , 4438, 9) + (Reference, , 4452, 12) + (Reference, , 4469, 9) + (Reference, , 4482, 12) + (Reference, , 4498, 9) + (Reference, , 4512, 9) + (Reference, , 4525, 9) + (Reference, , 4537, 12) + (Reference, , 4554, 9) + (Reference, , 4567, 12) + (Reference, , 4582, 9) + (Reference, , 4640, 10) + (Reference, , 4654, 16) + (Reference, , 4679, 10) + (Reference, , 4697, 16) + (Reference, , 4718, 16) + (Reference, , 4738, 10) + (Reference, , 4757, 16) + (Reference, , 4781, 10) + (Reference, , 4796, 13) + (Reference, , 4818, 16) + (Reference, , 4838, 10) + (Reference, , 4853, 13) + (Reference, , 4870, 10) + (Reference, , 4884, 16) + (Reference, , 4910, 9) + (Reference, , 4923, 12) + (Reference, , 4946, 9) + (Reference, , 4965, 12) + (Reference, , 4982, 12) + (Reference, , 4998, 9) + (Reference, , 5018, 12) + (Reference, , 5040, 9) + (Reference, , 5054, 9) + (Reference, , 5067, 12) + (Reference, , 5093, 9) + (Reference, , 5115, 12) + (Reference, , 5132, 12) + (Reference, , 5148, 9) + (Reference, , 5171, 12) + (Reference, , 5196, 9) + (Reference, , 5210, 9) + (Reference, , 5224, 16) + (Reference, , 5247, 10) + (Reference, , 5264, 12) + (Reference, , 5285, 9) + (Reference, , 5309, 12) + (Reference, , 5340, 10) + (Reference, , 5353, 16) + (Reference, , 5382, 9) + (Reference, , 5394, 12) + (Reference, , 5455, 11) + (Reference, , 5468, 11) + (Reference, , 5485, 12) + (Reference, , 5499, 10) + (Reference, , 5515, 10) + (Reference, , 5527, 11) + (Reference, , 5544, 11) + (Reference, , 5557, 10) + (Reference, , 5573, 11) + (Reference, , 5586, 11) + (Reference, , 5603, 12) + (Reference, , 5617, 10) + (Reference, , 5633, 9) + (Reference, , 5644, 11) + (Reference, , 5657, 10) + (Reference, , 5669, 11) + (Reference, , 5731, 10) + (Reference, , 5753, 13) + (Reference, , 5770, 10) + (Reference, , 5785, 10) + (Reference, , 5799, 13) + (Reference, , 5849, 10) + (Reference, , 5863, 11) + (Reference, , 5878, 7) + (Reference, , 5923, 13) + (Reference, , 5940, 10) + (Reference, , 5954, 7) + (Reference, , 6000, 10) + (Reference, , 6014, 16) + (Reference, , 6034, 11) + (Reference, , 6049, 7) + (Reference, , 6095, 16) + (Reference, , 6115, 10) + (Reference, , 6129, 11) + (Reference, , 6144, 7) + (ReferenceExpression, , 3740, 16) + (ReferenceExpression, , 3781, 10) + (ReferenceExpression, , 3809, 12) + (ReferenceExpression, , 3842, 9) + (ReferenceExpression, , 3869, 12) + (ReferenceExpression, , 3902, 9) + (ReferenceExpression, , 3957, 11) + (ReferenceExpression, , 3988, 14) + (ReferenceExpression, , 4044, 9) + (ReferenceExpression, , 4071, 12) + (ReferenceExpression, , 4256, 10) + (ReferenceExpression, , 4269, 16) + (ReferenceExpression, , 4307, 16) + (ReferenceExpression, , 4326, 10) + (ReferenceExpression, , 4354, 10) + (ReferenceExpression, , 4367, 11) + (ReferenceExpression, , 4396, 11) + (ReferenceExpression, , 4410, 10) + (ReferenceExpression, , 4438, 9) + (ReferenceExpression, , 4452, 12) + (ReferenceExpression, , 4482, 12) + (ReferenceExpression, , 4498, 9) + (ReferenceExpression, , 4525, 9) + (ReferenceExpression, , 4537, 12) + (ReferenceExpression, , 4567, 12) + (ReferenceExpression, , 4582, 9) + (ReferenceExpression, , 4654, 16) + (ReferenceExpression, , 4697, 16) + (ReferenceExpression, , 4738, 10) + (ReferenceExpression, , 4781, 10) + (ReferenceExpression, , 4818, 16) + (ReferenceExpression, , 4838, 10) + (ReferenceExpression, , 4870, 10) + (ReferenceExpression, , 4884, 16) + (ReferenceExpression, , 4923, 12) + (ReferenceExpression, , 4965, 12) + (ReferenceExpression, , 4998, 9) + (ReferenceExpression, , 5040, 9) + (ReferenceExpression, , 5067, 12) + (ReferenceExpression, , 5115, 12) + (ReferenceExpression, , 5148, 9) + (ReferenceExpression, , 5196, 9) + (ReferenceExpression, , 5224, 16) + (ReferenceExpression, , 5247, 10) + (ReferenceExpression, , 5264, 12) + (ReferenceExpression, , 5285, 9) + (ReferenceExpression, , 5340, 10) + (ReferenceExpression, , 5353, 16) + (ReferenceExpression, , 5382, 9) + (ReferenceExpression, , 5394, 12) + (ReferenceExpression, , 5468, 11) + (ReferenceExpression, , 5499, 10) + (ReferenceExpression, , 5586, 11) + (ReferenceExpression, , 5617, 10) + (ReferenceExpression, , 5644, 11) + (ReferenceExpression, , 5657, 10) + (ReferenceExpression, , 5669, 11) + (ReferenceExpression, , 5770, 10) + (ReferenceExpression, , 5799, 13) + (ReferenceExpression, , 5849, 10) + (ReferenceExpression, , 5878, 7) + (ReferenceExpression, , 5923, 13) + (ReferenceExpression, , 5954, 7) + (ReferenceExpression, , 6000, 10) + (ReferenceExpression, , 6014, 16) + (ReferenceExpression, , 6049, 7) + (ReferenceExpression, , 6095, 16) + (ReferenceExpression, , 6115, 10) + (ReferenceExpression, , 6144, 7) + (ReferenceSegment, base_array, 5731, 10) + (ReferenceSegment, base_array, 5770, 10) + (ReferenceSegment, base_array, 5785, 10) + (ReferenceSegment, base_array, 5849, 10) + (ReferenceSegment, base_flag, 3856, 9) + (ReferenceSegment, base_flag, 3902, 9) + (ReferenceSegment, base_flag, 4341, 9) + (ReferenceSegment, base_flag, 4383, 9) + (ReferenceSegment, base_flag, 4425, 9) + (ReferenceSegment, base_flag, 4438, 9) + (ReferenceSegment, base_flag, 4469, 9) + (ReferenceSegment, base_flag, 4498, 9) + (ReferenceSegment, base_flag, 5054, 9) + (ReferenceSegment, base_flag, 5093, 9) + (ReferenceSegment, base_flag, 5148, 9) + (ReferenceSegment, base_flag, 5196, 9) + (ReferenceSegment, base_flag, 5210, 9) + (ReferenceSegment, base_impl, 4007, 9) + (ReferenceSegment, base_impl, 4044, 9) + (ReferenceSegment, base_impl, 4058, 9) + (ReferenceSegment, base_object, 3916, 11) + (ReferenceSegment, base_object, 3957, 11) + (ReferenceSegment, base_object, 3973, 11) + (ReferenceSegment, base_real, 3796, 9) + (ReferenceSegment, base_real, 3842, 9) + (ReferenceSegment, base_real, 4512, 9) + (ReferenceSegment, base_real, 4525, 9) + (ReferenceSegment, base_real, 4554, 9) + (ReferenceSegment, base_real, 4582, 9) + (ReferenceSegment, base_real, 4910, 9) + (ReferenceSegment, base_real, 4946, 9) + (ReferenceSegment, base_real, 4998, 9) + (ReferenceSegment, base_real, 5040, 9) + (ReferenceSegment, base_real, 5285, 9) + (ReferenceSegment, base_real, 5382, 9) + (ReferenceSegment, base_value, 3726, 10) + (ReferenceSegment, base_value, 3781, 10) + (ReferenceSegment, base_value, 4256, 10) + (ReferenceSegment, base_value, 4326, 10) + (ReferenceSegment, base_value, 4354, 10) + (ReferenceSegment, base_value, 4410, 10) + (ReferenceSegment, base_value, 4640, 10) + (ReferenceSegment, base_value, 4679, 10) + (ReferenceSegment, base_value, 4738, 10) + (ReferenceSegment, base_value, 4781, 10) + (ReferenceSegment, base_value, 4838, 10) + (ReferenceSegment, base_value, 4870, 10) + (ReferenceSegment, base_value, 5247, 10) + (ReferenceSegment, base_value, 5340, 10) + (ReferenceSegment, base_value, 5499, 10) + (ReferenceSegment, base_value, 5557, 10) + (ReferenceSegment, base_value, 5617, 10) + (ReferenceSegment, base_value, 5657, 10) + (ReferenceSegment, base_value, 5940, 10) + (ReferenceSegment, base_value, 6000, 10) + (ReferenceSegment, base_value, 6115, 10) + (ReferenceSegment, child_value, 4367, 11) + (ReferenceSegment, child_value, 4396, 11) + (ReferenceSegment, child_value, 5468, 11) + (ReferenceSegment, child_value, 5527, 11) + (ReferenceSegment, child_value, 5586, 11) + (ReferenceSegment, child_value, 5644, 11) + (ReferenceSegment, child_value, 5669, 11) + (ReferenceSegment, child_value, 5863, 11) + (ReferenceSegment, child_value, 6034, 11) + (ReferenceSegment, child_value, 6129, 11) + (ReferenceSegment, derived_array, 5753, 13) + (ReferenceSegment, derived_array, 5799, 13) + (ReferenceSegment, derived_array, 5923, 13) + (ReferenceSegment, derived_flag, 3869, 12) + (ReferenceSegment, derived_flag, 3886, 12) + (ReferenceSegment, derived_flag, 4452, 12) + (ReferenceSegment, derived_flag, 4482, 12) + (ReferenceSegment, derived_flag, 5067, 12) + (ReferenceSegment, derived_flag, 5115, 12) + (ReferenceSegment, derived_flag, 5132, 12) + (ReferenceSegment, derived_flag, 5171, 12) + (ReferenceSegment, derived_flag, 5309, 12) + (ReferenceSegment, derived_impl, 4028, 12) + (ReferenceSegment, derived_impl, 4071, 12) + (ReferenceSegment, derived_object, 3939, 14) + (ReferenceSegment, derived_object, 3988, 14) + (ReferenceSegment, derived_real, 3809, 12) + (ReferenceSegment, derived_real, 3826, 12) + (ReferenceSegment, derived_real, 4537, 12) + (ReferenceSegment, derived_real, 4567, 12) + (ReferenceSegment, derived_real, 4923, 12) + (ReferenceSegment, derived_real, 4965, 12) + (ReferenceSegment, derived_real, 4982, 12) + (ReferenceSegment, derived_real, 5018, 12) + (ReferenceSegment, derived_real, 5264, 12) + (ReferenceSegment, derived_real, 5394, 12) + (ReferenceSegment, element, 5878, 7) + (ReferenceSegment, element, 5954, 7) + (ReferenceSegment, element, 6049, 7) + (ReferenceSegment, element, 6144, 7) + (ReferenceSegment, grandchild_value, 3740, 16) + (ReferenceSegment, grandchild_value, 3761, 16) + (ReferenceSegment, grandchild_value, 4269, 16) + (ReferenceSegment, grandchild_value, 4307, 16) + (ReferenceSegment, grandchild_value, 4654, 16) + (ReferenceSegment, grandchild_value, 4697, 16) + (ReferenceSegment, grandchild_value, 4718, 16) + (ReferenceSegment, grandchild_value, 4757, 16) + (ReferenceSegment, grandchild_value, 4818, 16) + (ReferenceSegment, grandchild_value, 4884, 16) + (ReferenceSegment, grandchild_value, 5224, 16) + (ReferenceSegment, grandchild_value, 5353, 16) + (ReferenceSegment, grandchild_value, 6014, 16) + (ReferenceSegment, grandchild_value, 6095, 16) + (ReferenceSegment, input_base, 5515, 10) + (ReferenceSegment, input_child, 5544, 11) + (ReferenceSegment, operation, 5633, 9) + (ReferenceSegment, output_base, 5455, 11) + (ReferenceSegment, output_child, 5485, 12) + (ReferenceSegment, raised_base, 5573, 11) + (ReferenceSegment, raised_child, 5603, 12) + (ReferenceSegment, sibling_value, 4239, 13) + (ReferenceSegment, sibling_value, 4290, 13) + (ReferenceSegment, sibling_value, 4796, 13) + (ReferenceSegment, sibling_value, 4853, 13) diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt new file mode 100644 index 00000000000..5fd5d95eb3a --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt @@ -0,0 +1,226 @@ +annex[0] owner=IncompatibleExtensions::host.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=base_value + ownedValueConstant : BehaviorIntegerLiteral + variables[1] : BehaviorVariable name=child_value + ownedValueConstant : BehaviorIntegerLiteral + variables[2] : BehaviorVariable name=sibling_value + ownedValueConstant : BehaviorIntegerLiteral + variables[3] : BehaviorVariable name=real_value + ownedValueConstant : BehaviorRealLiteral + variables[4] : BehaviorVariable name=opaque_value + variables[5] : BehaviorVariable name=numeric_value + ownedValueConstant : BehaviorIntegerLiteral + variables[6] : BehaviorVariable name=unrelated_real + ownedValueConstant : BehaviorRealLiteral + variables[7] : BehaviorVariable name=derived_flag + ownedValueConstant : BehaviorBooleanLiteral + variables[8] : BehaviorVariable name=unrelated_flag + ownedValueConstant : BehaviorBooleanLiteral + variables[9] : BehaviorVariable name=base_array + arrayDimension[0] : ArrayDimension + size : BehaviorArraySize + integerValue : BehaviorIntegerLiteral + variables[10] : BehaviorVariable name=larger_array + arrayDimension[0] : ArrayDimension + size : BehaviorArraySize + integerValue : BehaviorIntegerLiteral + variables[11] : BehaviorVariable name=matrix + arrayDimension[0] : ArrayDimension + size : BehaviorArraySize + integerValue : BehaviorIntegerLiteral + arrayDimension[1] : ArrayDimension + size : BehaviorArraySize + integerValue : BehaviorIntegerLiteral + states[0] : BehaviorState name=start + states[1] : BehaviorState name=done + transitions[0] : BehaviorTransition name=siblings + transitions[1] : BehaviorTransition name=sibling_operands + transitions[2] : BehaviorTransition name=changed_child + transitions[3] : BehaviorTransition name=changed_parent + transitions[4] : BehaviorTransition name=changed_operands + transitions[5] : BehaviorTransition name=unknown_parent + transitions[6] : BehaviorTransition name=unknown_child + transitions[7] : BehaviorTransition name=extent + transitions[8] : BehaviorTransition name=rank + transitions[9] : BehaviorTransition name=integer_literal_left + transitions[10] : BehaviorTransition name=integer_literal_right + transitions[11] : BehaviorTransition name=real_literal_left + transitions[12] : BehaviorTransition name=real_literal_right + transitions[13] : BehaviorTransition name=boolean_literal_left + transitions[14] : BehaviorTransition name=boolean_literal_right + actions[0] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=child_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=sibling_value [BehaviorVariable] + actions[1] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=base_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=child_value [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=sibling_value [BehaviorVariable] + actions[2] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=base_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=real_value [BehaviorVariable] + actions[3] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=real_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + actions[4] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=base_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=real_value [BehaviorVariable] + actions[5] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=opaque_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=numeric_value [BehaviorVariable] + actions[6] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : AssignmentAction + target : BehaviorVariableHolder element=opaque_value [BehaviorVariable] + valueExpression : Any + actions[1] : AssignmentAction + target : BehaviorVariableHolder element=numeric_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=opaque_value [BehaviorVariable] + actions[7] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : AssignmentAction + target : BehaviorVariableHolder element=larger_array [BehaviorVariable] + valueExpression : Any + actions[1] : AssignmentAction + target : BehaviorVariableHolder element=base_array [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=larger_array [BehaviorVariable] + actions[8] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : AssignmentAction + target : BehaviorVariableHolder element=matrix [BehaviorVariable] + valueExpression : Any + actions[1] : AssignmentAction + target : BehaviorVariableHolder element=base_array [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=matrix [BehaviorVariable] + actions[9] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=child_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=sibling_value [BehaviorVariable] + actions[10] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=child_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=sibling_value [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[11] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=unrelated_real [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorRealLiteral + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=real_value [BehaviorVariable] + actions[12] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=unrelated_real [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=real_value [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorRealLiteral + actions[13] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=unrelated_flag [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral + relations[1] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=derived_flag [BehaviorVariable] + actions[14] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=unrelated_flag [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=derived_flag [BehaviorVariable] + relations[1] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3261_Issue3261.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3261_Issue3261.txt new file mode 100644 index 00000000000..9b773e52ca7 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3261_Issue3261.txt @@ -0,0 +1,49 @@ +annex[0] owner=Issue3261::host.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=base_value + ownedValueConstant : BehaviorIntegerLiteral + variables[1] : BehaviorVariable name=grandchild_value + ownedValueConstant : BehaviorIntegerLiteral + states[0] : BehaviorState name=start + states[1] : BehaviorState name=done + transitions[0] : BehaviorTransition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : AssignmentAction + target : BehaviorVariableHolder element=base_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=grandchild_value [BehaviorVariable] + actions[1] : AssignmentAction + target : BehaviorVariableHolder element=grandchild_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + actions[2] : AssignmentAction + target : BehaviorVariableHolder element=base_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=grandchild_value [BehaviorVariable] + actions[3] : AssignmentAction + target : BehaviorVariableHolder element=base_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=grandchild_value [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_value [BehaviorVariable] diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3261_TypeExtensions.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3261_TypeExtensions.txt new file mode 100644 index 00000000000..c2bd936cbb1 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3261_TypeExtensions.txt @@ -0,0 +1,609 @@ +annex[0] owner=TypeExtensions::host.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=base_value + ownedValueConstant : BehaviorIntegerLiteral + variables[1] : BehaviorVariable name=child_value + ownedValueConstant : BehaviorIntegerLiteral + variables[2] : BehaviorVariable name=grandchild_value + ownedValueConstant : BehaviorIntegerLiteral + variables[3] : BehaviorVariable name=sibling_value + ownedValueConstant : BehaviorIntegerLiteral + variables[4] : BehaviorVariable name=base_real + ownedValueConstant : BehaviorRealLiteral + variables[5] : BehaviorVariable name=derived_real + ownedValueConstant : BehaviorRealLiteral + variables[6] : BehaviorVariable name=base_flag + ownedValueConstant : BehaviorBooleanLiteral + variables[7] : BehaviorVariable name=derived_flag + ownedValueConstant : BehaviorBooleanLiteral + variables[8] : BehaviorVariable name=base_object + variables[9] : BehaviorVariable name=derived_object + variables[10] : BehaviorVariable name=base_impl + variables[11] : BehaviorVariable name=derived_impl + variables[12] : BehaviorVariable name=base_array + arrayDimension[0] : ArrayDimension + size : BehaviorArraySize + integerValue : BehaviorIntegerLiteral + variables[13] : BehaviorVariable name=derived_array + arrayDimension[0] : ArrayDimension + size : BehaviorArraySize + integerValue : BehaviorIntegerLiteral + states[0] : BehaviorState name=start + states[1] : BehaviorState name=done + transitions[0] : BehaviorTransition name=assignments + transitions[1] : BehaviorTransition name=expressions + transitions[2] : BehaviorTransition name=literal_operands + transitions[3] : BehaviorTransition name=communications + transitions[4] : BehaviorTransition name=arrays_and_ranges + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : AssignmentAction + target : BehaviorVariableHolder element=base_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=grandchild_value [BehaviorVariable] + actions[1] : AssignmentAction + target : BehaviorVariableHolder element=grandchild_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + actions[2] : AssignmentAction + target : BehaviorVariableHolder element=base_real [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=derived_real [BehaviorVariable] + actions[3] : AssignmentAction + target : BehaviorVariableHolder element=derived_real [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_real [BehaviorVariable] + actions[4] : AssignmentAction + target : BehaviorVariableHolder element=base_flag [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=derived_flag [BehaviorVariable] + actions[5] : AssignmentAction + target : BehaviorVariableHolder element=derived_flag [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_flag [BehaviorVariable] + actions[6] : AssignmentAction + target : BehaviorVariableHolder element=base_object [BehaviorVariable] + valueExpression : Any + actions[7] : AssignmentAction + target : BehaviorVariableHolder element=derived_object [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_object [BehaviorVariable] + actions[8] : AssignmentAction + target : BehaviorVariableHolder element=base_object [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=derived_object [BehaviorVariable] + actions[9] : AssignmentAction + target : BehaviorVariableHolder element=base_impl [BehaviorVariable] + valueExpression : Any + actions[10] : AssignmentAction + target : BehaviorVariableHolder element=derived_impl [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_impl [BehaviorVariable] + actions[11] : AssignmentAction + target : BehaviorVariableHolder element=base_impl [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=derived_impl [BehaviorVariable] + actions[1] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : AssignmentAction + target : BehaviorVariableHolder element=sibling_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=grandchild_value [BehaviorVariable] + actions[1] : AssignmentAction + target : BehaviorVariableHolder element=sibling_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=grandchild_value [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + actions[2] : AssignmentAction + target : BehaviorVariableHolder element=base_flag [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + secondExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=child_value [BehaviorVariable] + actions[3] : AssignmentAction + target : BehaviorVariableHolder element=base_flag [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=child_value [BehaviorVariable] + secondExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + actions[4] : AssignmentAction + target : BehaviorVariableHolder element=base_flag [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_flag [BehaviorVariable] + relations[1] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=derived_flag [BehaviorVariable] + actions[5] : AssignmentAction + target : BehaviorVariableHolder element=base_flag [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=derived_flag [BehaviorVariable] + relations[1] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_flag [BehaviorVariable] + actions[6] : AssignmentAction + target : BehaviorVariableHolder element=base_real [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_real [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=derived_real [BehaviorVariable] + actions[7] : AssignmentAction + target : BehaviorVariableHolder element=base_real [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=derived_real [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_real [BehaviorVariable] + actions[2] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : AssignmentAction + target : BehaviorVariableHolder element=base_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=grandchild_value [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[1] : AssignmentAction + target : BehaviorVariableHolder element=base_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=grandchild_value [BehaviorVariable] + actions[2] : AssignmentAction + target : BehaviorVariableHolder element=grandchild_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[3] : AssignmentAction + target : BehaviorVariableHolder element=grandchild_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + actions[4] : AssignmentAction + target : BehaviorVariableHolder element=sibling_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=grandchild_value [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + actions[5] : AssignmentAction + target : BehaviorVariableHolder element=sibling_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=grandchild_value [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[6] : AssignmentAction + target : BehaviorVariableHolder element=base_real [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=derived_real [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorRealLiteral + actions[7] : AssignmentAction + target : BehaviorVariableHolder element=base_real [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorRealLiteral + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=derived_real [BehaviorVariable] + actions[8] : AssignmentAction + target : BehaviorVariableHolder element=derived_real [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_real [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorRealLiteral + actions[9] : AssignmentAction + target : BehaviorVariableHolder element=derived_real [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorRealLiteral + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_real [BehaviorVariable] + actions[10] : AssignmentAction + target : BehaviorVariableHolder element=base_flag [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=derived_flag [BehaviorVariable] + relations[1] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral + actions[11] : AssignmentAction + target : BehaviorVariableHolder element=base_flag [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral + relations[1] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=derived_flag [BehaviorVariable] + actions[12] : AssignmentAction + target : BehaviorVariableHolder element=derived_flag [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_flag [BehaviorVariable] + relations[1] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral + actions[13] : AssignmentAction + target : BehaviorVariableHolder element=derived_flag [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral + relations[1] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_flag [BehaviorVariable] + actions[14] : AssignmentAction + target : BehaviorVariableHolder element=base_flag [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=grandchild_value [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + secondExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + relations[1] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=derived_real [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorRealLiteral + secondExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_real [BehaviorVariable] + relations[2] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral + actions[15] : AssignmentAction + target : BehaviorVariableHolder element=derived_flag [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral + relations[1] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + secondExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=grandchild_value [BehaviorVariable] + relations[1] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorRealLiteral + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_real [BehaviorVariable] + secondExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=derived_real [BehaviorVariable] + actions[3] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : PortSendAction + port : DataPortHolder element=TypeExtensions::host.output_base [DataPort] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=child_value [BehaviorVariable] + actions[1] : PortSendAction + port : DataPortHolder element=TypeExtensions::host.output_child [DataPort] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + actions[2] : PortDequeueAction + port : EventDataPortHolder element=TypeExtensions::host.input_base [EventDataPort] + target : BehaviorVariableHolder element=child_value [BehaviorVariable] + actions[3] : PortDequeueAction + port : EventDataPortHolder element=TypeExtensions::host.input_child [EventDataPort] + target : BehaviorVariableHolder element=base_value [BehaviorVariable] + actions[4] : InternalPortSendAction + internalPort : EventDataSourceHolder element=TypeExtensions::host.impl.raised_base [EventDataSource] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=child_value [BehaviorVariable] + actions[5] : InternalPortSendAction + internalPort : EventDataSourceHolder element=TypeExtensions::host.impl.raised_child [EventDataSource] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + actions[6] : SubprogramCallAction + subprogram : SubprogramHolder element=TypeExtensions::operation [SubprogramType] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=child_value [BehaviorVariable] + parameterLabels[1] : BehaviorVariableHolder element=base_value [BehaviorVariable] + parameterLabels[2] : BehaviorVariableHolder element=child_value [BehaviorVariable] + actions[4] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : AssignmentAction + target : BehaviorVariableHolder element=base_array [BehaviorVariable] + valueExpression : Any + actions[1] : AssignmentAction + target : BehaviorVariableHolder element=derived_array [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=base_array [BehaviorVariable] + actions[2] : AssignmentAction + target : BehaviorVariableHolder element=base_array [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=derived_array [BehaviorVariable] + actions[3] : ForOrForAllStatement + behaviorActions : AssignmentAction + target : BehaviorVariableHolder element=child_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : IterativeVariableHolder element=element [IterativeVariable] + iteratedValues : BehaviorVariableHolder element=base_array [BehaviorVariable] + iterativeVariable : IterativeVariable name=element + actions[4] : ForOrForAllStatement + behaviorActions : AssignmentAction + target : BehaviorVariableHolder element=base_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : IterativeVariableHolder element=element [IterativeVariable] + iteratedValues : BehaviorVariableHolder element=derived_array [BehaviorVariable] + iterativeVariable : IterativeVariable name=element + actions[5] : ForOrForAllStatement + behaviorActions : AssignmentAction + target : BehaviorVariableHolder element=child_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : IterativeVariableHolder element=element [IterativeVariable] + iteratedValues : IntegerRange + lowerIntegerValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + upperIntegerValue : BehaviorVariableHolder element=grandchild_value [BehaviorVariable] + iterativeVariable : IterativeVariable name=element + actions[6] : ForOrForAllStatement + behaviorActions : AssignmentAction + target : BehaviorVariableHolder element=child_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : IterativeVariableHolder element=element [IterativeVariable] + iteratedValues : IntegerRange + lowerIntegerValue : BehaviorVariableHolder element=grandchild_value [BehaviorVariable] + upperIntegerValue : BehaviorVariableHolder element=base_value [BehaviorVariable] + iterativeVariable : IterativeVariable name=element diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt new file mode 100644 index 00000000000..c2885130c66 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3261_IncompatibleExtensions.txt @@ -0,0 +1,35 @@ +===== annex[0] owner=IncompatibleExtensions::host.impl ===== + +\tvariables +\t\tbase_value : integer_type := 1; +\t\tchild_value : child_integer := 2; +\t\tsibling_value : sibling_integer := 3; +\t\treal_value : changed_representation := 1.0; +\t\topaque_value : opaque; +\t\tnumeric_value : numeric_opaque := 1; +\t\tunrelated_real : real_type := 0.0; +\t\tderived_flag : child_boolean := true; +\t\tunrelated_flag : unrelated_boolean := false; +\t\tbase_array[2] : integer_type; +\t\tlarger_array[3], matrix[2][2] : child_integer; +\tstates +\t\tstart : initial state; +\t\tdone : final state; +\ttransitions +\t\tsiblings : start -[]-> done { child_value := sibling_value }; +\t\tsibling_operands : start -[]-> done { base_value := child_value + sibling_value }; +\t\tchanged_child : start -[]-> done { base_value := real_value }; +\t\tchanged_parent : start -[]-> done { real_value := base_value }; +\t\tchanged_operands : start -[]-> done { base_value := base_value + real_value }; +\t\tunknown_parent : start -[]-> done { opaque_value := numeric_value }; +\t\tunknown_child : start -[]-> done { opaque_value := any; numeric_value := opaque_value }; +\t\textent : start -[]-> done { larger_array := any; base_array := larger_array }; +\t\trank : start -[]-> done { matrix := any; base_array := matrix }; +\t\tinteger_literal_left : start -[]-> done { child_value := 1 + sibling_value }; +\t\tinteger_literal_right : start -[]-> done { child_value := sibling_value + 1 }; +\t\treal_literal_left : start -[]-> done { unrelated_real := 1.0 + real_value }; +\t\treal_literal_right : start -[]-> done { unrelated_real := real_value + 1.0 }; +\t\tboolean_literal_left : start -[]-> done { unrelated_flag := true and derived_flag }; +\t\tboolean_literal_right : start -[]-> done { unrelated_flag := derived_flag or false }; +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3261_Issue3261.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3261_Issue3261.txt new file mode 100644 index 00000000000..aee6b648bd7 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3261_Issue3261.txt @@ -0,0 +1,17 @@ +===== annex[0] owner=Issue3261::host.impl ===== + + variables + base_value : integer_type := 1; + grandchild_value : grandchild_integer := 3; + states + start : initial state; + done : final state; + transitions + start -[]-> done { + base_value := grandchild_value; + grandchild_value := base_value; + base_value := base_value + grandchild_value; + base_value := grandchild_value + base_value + }; +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3261_TypeExtensions.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3261_TypeExtensions.txt new file mode 100644 index 00000000000..9fd04a8929d --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3261_TypeExtensions.txt @@ -0,0 +1,84 @@ +===== annex[0] owner=TypeExtensions::host.impl ===== + +\tvariables +\t\tbase_value : integer_type := 1; +\t\tchild_value : child_integer := 2; +\t\tgrandchild_value : grandchild_integer := 3; +\t\tsibling_value : sibling_integer := 0; +\t\tbase_real : real_type := 1.0; +\t\tderived_real : child_real := 2.0; +\t\tbase_flag : boolean_type := true; +\t\tderived_flag : child_boolean := false; +\t\tbase_object : opaque; +\t\tderived_object : child_opaque; +\t\tbase_impl : opaque.impl; +\t\tderived_impl : opaque.extended; +\t\tbase_array[2] : integer_type; +\t\tderived_array[2] : child_integer; +\tstates +\t\tstart : initial state; +\t\tdone : final state; +\ttransitions +\t\tassignments : start -[]-> done { +\t\t\tbase_value := grandchild_value; +\t\t\tgrandchild_value := base_value; +\t\t\tbase_real := derived_real; +\t\t\tderived_real := base_real; +\t\t\tbase_flag := derived_flag; +\t\t\tderived_flag := base_flag; +\t\t\tbase_object := any; +\t\t\tderived_object := base_object; +\t\t\tbase_object := derived_object; +\t\t\tbase_impl := any; +\t\t\tderived_impl := base_impl; +\t\t\tbase_impl := derived_impl +\t\t}; +\t\t-- A mixed expression has the base type in either operand order. Its value can then be assigned to a sibling. +\t\texpressions : start -[]-> done { +\t\t\tsibling_value := base_value + grandchild_value; +\t\t\tsibling_value := grandchild_value + base_value; +\t\t\tbase_flag := base_value < child_value; +\t\t\tbase_flag := child_value > base_value; +\t\t\tbase_flag := base_flag and derived_flag; +\t\t\tbase_flag := derived_flag or base_flag; +\t\t\tbase_real := base_real + derived_real; +\t\t\tbase_real := derived_real + base_real +\t\t}; +\t\tliteral_operands : start -[]-> done { +\t\t\tbase_value := grandchild_value + 1; +\t\t\tbase_value := 1 + grandchild_value; +\t\t\tgrandchild_value := base_value + 1; +\t\t\tgrandchild_value := 1 + base_value; +\t\t\tsibling_value := (1 + grandchild_value) + base_value; +\t\t\tsibling_value := base_value + (grandchild_value + 1); +\t\t\tbase_real := derived_real + 1.0; +\t\t\tbase_real := 1.0 + derived_real; +\t\t\tderived_real := base_real + 1.0; +\t\t\tderived_real := 1.0 + base_real; +\t\t\tbase_flag := derived_flag and true; +\t\t\tbase_flag := false or derived_flag; +\t\t\tderived_flag := base_flag and true; +\t\t\tderived_flag := false or base_flag; +\t\t\tbase_flag := (grandchild_value + 1 > base_value) and (derived_real + 1.0 > base_real) and true; +\t\t\tderived_flag := false or ((1 + base_value < grandchild_value) and (1.0 + base_real < derived_real)) +\t\t}; +\t\tcommunications : start -[]-> done { +\t\t\toutput_base!(child_value); +\t\t\toutput_child!(base_value); +\t\t\tinput_base?(child_value); +\t\t\tinput_child?(base_value); +\t\t\traised_base!(child_value); +\t\t\traised_child!(base_value); +\t\t\toperation!(child_value, base_value, child_value) +\t\t}; +\t\tarrays_and_ranges : start -[]-> done { +\t\t\tbase_array := any; +\t\t\tderived_array := base_array; +\t\t\tbase_array := derived_array; +\t\t\tfor (element : child_integer in base_array) { child_value := element }; +\t\t\tfor (element : integer_type in derived_array) { base_value := element }; +\t\t\tfor (element : child_integer in base_value .. grandchild_value) { child_value := element }; +\t\t\tfor (element : child_integer in grandchild_value .. base_value) { child_value := element } +\t\t}; +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3199Test.java b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3199Test.java index 1b4d729f804..76904671f18 100644 --- a/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3199Test.java +++ b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3199Test.java @@ -55,11 +55,9 @@ public class Issue3199Test extends XtextTest { private ValidationTestHelper validationHelper; @Test - public void classifierNamesAndExpressionResultsMustMatch() throws Exception { + public void unrelatedClassifiersAndRealizationsRemainDistinct() throws Exception { assertDiagnostics("ClassifierIdentity", List.of(new Expected("second", "type error for 'assignment', 'ClassifierIdentity::first_type' expected, found 'ClassifierIdentity::second_type'."), - new Expected("child", - "type error for 'assignment', 'ClassifierIdentity::first_type' expected, found 'ClassifierIdentity::child_type'."), new Expected("implementation", "type error for 'assignment', 'ClassifierIdentity::first_type' expected, found 'ClassifierIdentity::first_type.impl'."), new Expected("true and second_flag", diff --git a/ba/org.osate.ba/src/org/osate/ba/analyzers/AdaLikeDataTypeChecker.java b/ba/org.osate.ba/src/org/osate/ba/analyzers/AdaLikeDataTypeChecker.java index c23cebbce0e..46c9d9501f3 100644 --- a/ba/org.osate.ba/src/org/osate/ba/analyzers/AdaLikeDataTypeChecker.java +++ b/ba/org.osate.ba/src/org/osate/ba/analyzers/AdaLikeDataTypeChecker.java @@ -22,6 +22,7 @@ package org.osate.ba.analyzers; import org.eclipse.emf.common.util.Enumerator; +import org.osate.aadl2.DataClassifier; import org.osate.aadl2.RangeValue; import org.osate.aadl2.modelsupport.errorreporting.AnalysisErrorReporterManager; import org.osate.ba.aadlba.BehaviorElement; @@ -92,9 +93,12 @@ public boolean conformsTo(TypeHolder type1, TypeHolder type2, boolean hasToCheck return true; } if (type1.getKlass() != null && type2.getKlass() != null) { - // Annex D does not define classifier substitutability. OSATE uses nominal equality, including for - // classifiers without a Data_Representation; extension and type/implementation pairs are distinct. - if (!type1.getKlass().getQualifiedName().equalsIgnoreCase(type2.getKlass().getQualifiedName())) { + // Accept extensions in either direction when their representations agree. Sharing an ancestor is not + // sufficient, and a type/implementation realization is not an extension relationship. + if (!type1.getKlass().getQualifiedName().equalsIgnoreCase(type2.getKlass().getQualifiedName()) + && (type1.getDataRep() != type2.getDataRep() + || !isExtensionOf(type1.getKlass(), type2.getKlass()) + && !isExtensionOf(type2.getKlass(), type1.getKlass()))) { return false; } } @@ -112,6 +116,11 @@ private static boolean isUniversalReal(TypeHolder type) { return type.getKlass() == null && type.getDataRep() == DataRepresentation.FLOAT; } + private static boolean isExtensionOf(DataClassifier classifier, DataClassifier base) { + return classifier.getSelfPlusAllExtended().stream().skip(1) + .anyMatch(ancestor -> ancestor.getQualifiedName().equalsIgnoreCase(base.getQualifiedName())); + } + public TypeHolder getTopLevelType(TypeHolder type1, TypeHolder type2) { if (conformsTo(type1, type2, true)) return getTopLevelTypeWithoutConsistencyChecking(type1, type2); @@ -122,6 +131,11 @@ public TypeHolder getTopLevelType(TypeHolder type1, TypeHolder type2) { private TypeHolder getTopLevelTypeWithoutConsistencyChecking(TypeHolder type1, TypeHolder type2) { // A universal literal adopts the other operand's declared type, including fixed-point representation. var source = type1.getKlass() != null || type2.getKlass() == null ? type1 : type2; + // A base/extension expression has the base classifier regardless of operand order. + if (type1.getKlass() != null && type2.getKlass() != null + && isExtensionOf(type1.getKlass(), type2.getKlass())) { + source = type2; + } var result = new TypeHolder(source.getDataRep(), source.getKlass()); result.setDimension(source.getDimension()); var sizes = source.getDimensionSizes();