diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_array_types/array_type.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_array_types/array_type.ets similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_array_types/array_type.ets rename to plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_array_types/array_type.ets diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_array_types/cast_to_object.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_array_types/cast_to_object.ets similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_array_types/cast_to_object.ets rename to plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_array_types/cast_to_object.ets diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_array_types/cast_to_object_array.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_array_types/cast_to_object_array.ets similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_array_types/cast_to_object_array.ets rename to plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_array_types/cast_to_object_array.ets diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_array_types/cast_to_superclass.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_array_types/cast_to_superclass.ets similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_array_types/cast_to_superclass.ets rename to plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_array_types/cast_to_superclass.ets diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_array_types/primitive_cast_to_object.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_array_types/primitive_cast_to_object.ets similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_array_types/primitive_cast_to_object.ets rename to plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_array_types/primitive_cast_to_object.ets diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_cast_to_generic_superclass.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_cast_to_generic_superclass.ets similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_cast_to_generic_superclass.ets rename to plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_cast_to_generic_superclass.ets diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_cast_to_object.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_cast_to_object.ets similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_cast_to_object.ets rename to plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_cast_to_object.ets diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_cast_to_object_with_parameters.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_cast_to_object_with_parameters.ets similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_cast_to_object_with_parameters.ets rename to plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_cast_to_object_with_parameters.ets diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_cast_to_superclass.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_cast_to_superclass.ets similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_cast_to_superclass.ets rename to plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_cast_to_superclass.ets diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_sub_and_superinterfaces.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_sub_and_superinterfaces.ets similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_sub_and_superinterfaces.ets rename to plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_sub_and_superinterfaces.ets diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_suberinterface.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_suberinterface.ets similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_suberinterface.ets rename to plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/generic_suberinterface.ets diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/non_generic_cast_to_object.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/non_generic_cast_to_object.ets similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/non_generic_cast_to_object.ets rename to plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/non_generic_cast_to_object.ets diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/non_generic_cast_to_superclass.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/non_generic_cast_to_superclass.ets similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/non_generic_cast_to_superclass.ets rename to plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/non_generic_cast_to_superclass.ets diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/non_generic_superinterface.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/non_generic_superinterface.ets similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/non_generic_superinterface.ets rename to plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_class_and_interface_types/non_generic_superinterface.ets diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_primitive_types/primitive_types_cast.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_primitive_types/primitive_types_cast.ets similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_primitive_types/primitive_types_cast.ets rename to plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_primitive_types/primitive_types_cast.ets diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_primitive_types/primitive_types_cast.params.yaml b/plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_primitive_types/primitive_types_cast.params.yaml similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/01.subtyping/subtyping_among_primitive_types/primitive_types_cast.params.yaml rename to plugins/ets/tests/ets-templates/15.semantic_rules/01.subtyping/subtyping_among_primitive_types/primitive_types_cast.params.yaml diff --git a/plugins/ets/tests/ets-templates/15.semantic_rules/02.least_upper_bound/negative_cases.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/02.least_upper_bound/negative_cases.ets new file mode 100644 index 0000000000000000000000000000000000000000..cf19b3b91b98fc47d7a09f44965f3869babd5447 --- /dev/null +++ b/plugins/ets/tests/ets-templates/15.semantic_rules/02.least_upper_bound/negative_cases.ets @@ -0,0 +1,15 @@ +{% for c in cases %} +/*--- +desc: >- + The notion of the least upper bound (LUB) is used where a single type must be found that is a common supertype for + a set of reference types. +tags: [compile-only, negative] +params: '{{c.decl}}' +---*/ + +{{c.decl}} + +function main(): int { + return 0; +} +{% endfor %} diff --git a/plugins/ets/tests/ets-templates/15.semantic_rules/02.least_upper_bound/negative_cases.params.yaml b/plugins/ets/tests/ets-templates/15.semantic_rules/02.least_upper_bound/negative_cases.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..89a106fd95dd6d1ba6563bab7b1c62fd4d22e4bf --- /dev/null +++ b/plugins/ets/tests/ets-templates/15.semantic_rules/02.least_upper_bound/negative_cases.params.yaml @@ -0,0 +1,12 @@ +--- +cases: + - decl: |- + class A {} + class B {} + let lub: A[] = [ new A(), new B() ] + - decl: |- + interface A {} + class B implements A {} + class C {} + let lub: A[] = [ new B(), new C() ] + diff --git a/plugins/ets/tests/ets-templates/15.semantic_rules/02.least_upper_bound/positive_cases.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/02.least_upper_bound/positive_cases.ets new file mode 100644 index 0000000000000000000000000000000000000000..04a9dfc2356dc381f234afcbcceb2bbc5fca1f09 --- /dev/null +++ b/plugins/ets/tests/ets-templates/15.semantic_rules/02.least_upper_bound/positive_cases.ets @@ -0,0 +1,15 @@ +{% for c in cases %} +/*--- +desc: >- + The notion of the least upper bound (LUB) is used where a single type must be found that is a common supertype for + a set of reference types. +tags: [compile-only] +params: '{{c.decl}}' +---*/ + +{{c.decl}} + +function main(): int { + return 0; +} +{% endfor %} diff --git a/plugins/ets/tests/ets-templates/15.semantic_rules/02.least_upper_bound/positive_cases.params.yaml b/plugins/ets/tests/ets-templates/15.semantic_rules/02.least_upper_bound/positive_cases.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f5e5cf3effe23f0750ff0d6ee99f40af493e8a50 --- /dev/null +++ b/plugins/ets/tests/ets-templates/15.semantic_rules/02.least_upper_bound/positive_cases.params.yaml @@ -0,0 +1,22 @@ +--- +cases: + - decl: |- + class X {} + class Y {} + class Z {} + let lub: Object[] = [ new X(), new Y(), new Z() ] + - decl: |- + class A {} + class B extends A {} + class C extends B {} + let lub: A[] = [ new A(), new B(), new C() ] + - decl: |- + interface A {} + class B implements A {} + class C extends B {} + let lub: A[] = [ new B(), new C() ] + - decl: |- + let lub: Object[] = [ new Int(), new String(), new Date(), new Object[1] ] + - decl: |- + let lub: Object[] = [ "string", [0, 1, 2], 2 ] + diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/03.override_equivalent_signatures/neg.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/03.override_equivalent_signatures/neg.ets similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/03.override_equivalent_signatures/neg.ets rename to plugins/ets/tests/ets-templates/15.semantic_rules/03.override_equivalent_signatures/neg.ets diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/03.override_equivalent_signatures/neg.params.yaml b/plugins/ets/tests/ets-templates/15.semantic_rules/03.override_equivalent_signatures/neg.params.yaml similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/03.override_equivalent_signatures/neg.params.yaml rename to plugins/ets/tests/ets-templates/15.semantic_rules/03.override_equivalent_signatures/neg.params.yaml diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/03.override_equivalent_signatures/pos.ets b/plugins/ets/tests/ets-templates/15.semantic_rules/03.override_equivalent_signatures/pos.ets similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/03.override_equivalent_signatures/pos.ets rename to plugins/ets/tests/ets-templates/15.semantic_rules/03.override_equivalent_signatures/pos.ets diff --git a/plugins/ets/tests/ets-templates/14.semantic_rules/03.override_equivalent_signatures/pos.params.yaml b/plugins/ets/tests/ets-templates/15.semantic_rules/03.override_equivalent_signatures/pos.params.yaml similarity index 100% rename from plugins/ets/tests/ets-templates/14.semantic_rules/03.override_equivalent_signatures/pos.params.yaml rename to plugins/ets/tests/ets-templates/15.semantic_rules/03.override_equivalent_signatures/pos.params.yaml diff --git a/tests/tests-u-runner/runner/plugins/ets/ets-cts-ignored.txt b/tests/tests-u-runner/runner/plugins/ets/ets-cts-ignored.txt index 63e4c0c49232734230940012901102777cc5a7f5..0d383a8b5d51629e1aa9ebd2b6378df167a3d958 100644 --- a/tests/tests-u-runner/runner/plugins/ets/ets-cts-ignored.txt +++ b/tests/tests-u-runner/runner/plugins/ets/ets-cts-ignored.txt @@ -1707,7 +1707,7 @@ 17.experimental_features/05.statements/05.function_overloading/fn_overloading_30.ets 04.names_declarations_and_scopes/08.function_declarations/02.parameter_list/param_list_12.ets 04.names_declarations_and_scopes/08.function_declarations/02.parameter_list/param_list_7.ets -14.semantic_rules/03.override_equivalent_signatures/pos_1.ets +15.semantic_rules/03.override_equivalent_signatures/pos_1.ets 04.names_declarations_and_scopes/08.function_declarations/03.optional_parameters/opt_param_0.ets 04.names_declarations_and_scopes/08.function_declarations/03.optional_parameters/opt_param_1.ets 04.names_declarations_and_scopes/08.function_declarations/03.optional_parameters/opt_param_10.ets @@ -1719,7 +1719,7 @@ 04.names_declarations_and_scopes/08.function_declarations/03.optional_parameters/opt_param_9.ets 05.generics/05.parameterized_declarations/type_arguments_of_parameterized_declarations/class_args_22.ets 05.generics/05.parameterized_declarations/type_arguments_of_parameterized_declarations/class_args_25.ets -14.semantic_rules/03.override_equivalent_signatures/pos_6.ets +15.semantic_rules/03.override_equivalent_signatures/pos_6.ets 04.names_declarations_and_scopes/08.function_declarations/06.return_type/ret_type_5.ets 04.names_declarations_and_scopes/08.function_declarations/06.return_type/ret_type_6.ets 04.names_declarations_and_scopes/08.function_declarations/06.return_type/ret_type_7.ets