diff --git a/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t06.dart b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t06.dart index c1b2dc3e7e..a387920d32 100644 --- a/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t06.dart +++ b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t06.dart @@ -47,7 +47,7 @@ class C2 implements I1, I2, I3 { // [cfe] unspecified void m2(int v1, {String s0 = ""}) {} -// ^ +// ^^ // [analyzer] unspecified // [cfe] unspecified } diff --git a/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t19.dart b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t19.dart new file mode 100644 index 0000000000..8022647214 --- /dev/null +++ b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t19.dart @@ -0,0 +1,39 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion Let m and m′ be member signatures with the same name id. Then m +/// is a correct override of m′ iff the following criteria are all satisfied: +/// ... +/// • If m and m′ are both methods or both setters: Let F be the function type +/// of m except that the parameter type is the built-in class Object for each +/// parameter of m which is covariant-by-declaration. Let F′ be the function +/// type of m′. F must then be a subtype of F′. +/// +/// @description Checks that it is a compile-time error if `m` and `m′` are both +/// setters and function type `m` is not a subtype of `m′`. Test `implements` +/// clause +/// @author sgrekhov22@gmail.com + +interface class I { + void set m(num n) {} +} + +class C implements I { + void set m(int i) {} +// ^ +// [analyzer] unspecified +// [cfe] unspecified +} + +mixin M implements I { + void set m(int i) {} +// ^ +// [analyzer] unspecified +// [cfe] unspecified +} + +main() { + print(C); + print(M); +} diff --git a/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t20.dart b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t20.dart new file mode 100644 index 0000000000..58a8ee06e0 --- /dev/null +++ b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t20.dart @@ -0,0 +1,43 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion Let m and m′ be member signatures with the same name id. Then m +/// is a correct override of m′ iff the following criteria are all satisfied: +/// ... +/// • If m and m′ are both methods or both setters: Let F be the function type +/// of m except that the parameter type is the built-in class Object for each +/// parameter of m which is covariant-by-declaration. Let F′ be the function +/// type of m′. F must then be a subtype of F′. +/// +/// @description Checks that it is a compile-time error if `m` and `m′` are both +/// setters and function type `m` is not a subtype of `m′`. Test `implements` +/// clause +/// @author sgrekhov22@gmail.com + +interface class I1 { + void set m(int i) {} +} + +interface class I2 { + void set m(Object i) {} +} + +class C implements I1, I2 { + void set m(num i) {} +// ^ +// [analyzer] unspecified +// [cfe] unspecified +} + +mixin M implements I1, I2 { + void set m(num i) {} +// ^ +// [analyzer] unspecified +// [cfe] unspecified +} + +main() { + print(C); + print(M); +} diff --git a/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t21.dart b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t21.dart new file mode 100644 index 0000000000..3608c54075 --- /dev/null +++ b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t21.dart @@ -0,0 +1,35 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion Let m and m′ be member signatures with the same name id. Then m +/// is a correct override of m′ iff the following criteria are all satisfied: +/// ... +/// • If m and m′ are both methods or both setters: Let F be the function type +/// of m except that the parameter type is the built-in class Object for each +/// parameter of m which is covariant-by-declaration. Let F′ be the function +/// type of m′. F must then be a subtype of F′. +/// +/// @description Checks that it is not an error if `m` and `m′` are both setters +/// and function type `m` is a subtype of `m′. Test `implements` clause +/// @author sgrekhov22@gmail.com + +interface class I { + void set m1(num v1) {} + void set m2(covariant int v1) {} +} + +class C implements I { + void set m1(covariant int i) {} + void set m2(num i) {} +} + +mixin M implements I { + void set m1(covariant int i) {} + void set m2(num i) {} +} + +main() { + print(C); + print(M); +} diff --git a/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t22.dart b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t22.dart new file mode 100644 index 0000000000..b8c48b0048 --- /dev/null +++ b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t22.dart @@ -0,0 +1,36 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion Let m and m′ be member signatures with the same name id. Then m +/// is a correct override of m′ iff the following criteria are all satisfied: +/// ... +/// • If m and m′ are both methods or both setters: Let F be the function type +/// of m except that the parameter type is the built-in class Object for each +/// parameter of m which is covariant-by-declaration. Let F′ be the function +/// type of m′. F must then be a subtype of F′. +/// +/// @description Checks that it is not an error if `m` and `m′` are both setters +/// and function type `m` is a subtype of `m′. Test `implements` clause +/// @author sgrekhov22@gmail.com + +interface class I1 { + void set m(num v1) {} +} + +interface class I2 { + void set m(covariant int v1) {} +} + +class C implements I1, I2 { + void set m(covariant int i) {} +} + +mixin M implements I1, I2 { + void set m(num i) {} +} + +main() { + print(C); + print(M); +} diff --git a/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t23.dart b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t23.dart new file mode 100644 index 0000000000..b425a52a03 --- /dev/null +++ b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t23.dart @@ -0,0 +1,50 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion Let m and m′ be member signatures with the same name id. Then m +/// is a correct override of m′ iff the following criteria are all satisfied: +/// ... +/// • If m and m′ are both methods or both setters: Let F be the function type +/// of m except that the parameter type is the built-in class Object for each +/// parameter of m which is covariant-by-declaration. Let F′ be the function +/// type of m′. F must then be a subtype of F′. +/// +/// @description Checks that it is a compile-time error if `m` and `m′` are both +/// setters and function type `m` is not a subtype of `m′. Test `implements` +/// clause +/// @author sgrekhov22@gmail.com + +interface class I { + void set m1(num v1) {} + void set m2(covariant int v1) {} +} + +class C implements I { + void set m1(covariant String i) {} +// ^^ +// [analyzer] unspecified +// [cfe] unspecified + + void set m2(String i) {} +// ^^ +// [analyzer] unspecified +// [cfe] unspecified +} + +mixin M implements I { + void set m1(covariant String i) {} +// ^^ +// [analyzer] unspecified +// [cfe] unspecified + + void set m2(String i) {} +// ^^ +// [analyzer] unspecified +// [cfe] unspecified +} + +main() { + print(C); + print(M); +} diff --git a/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t24.dart b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t24.dart new file mode 100644 index 0000000000..664ca6e24c --- /dev/null +++ b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t24.dart @@ -0,0 +1,39 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion Let m and m′ be member signatures with the same name id. Then m +/// is a correct override of m′ iff the following criteria are all satisfied: +/// ... +/// • If m and m′ are both methods or both setters: Let F be the function type +/// of m except that the parameter type is the built-in class Object for each +/// parameter of m which is covariant-by-declaration. Let F′ be the function +/// type of m′. F must then be a subtype of F′. +/// +/// @description Checks that it is a compile-time error if `m` and `m′` are both +/// setters and function type `m` is not a subtype of `m′`. Test `extends` and +/// `on` clauses +/// @author sgrekhov22@gmail.com + +interface class I { + void set m(num n) {} +} + +class C extends I { + void set m(int i) {} +// ^ +// [analyzer] unspecified +// [cfe] unspecified +} + +mixin M on I { + void set m(int i) {} +// ^ +// [analyzer] unspecified +// [cfe] unspecified +} + +main() { + print(C); + print(M); +} diff --git a/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t25.dart b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t25.dart new file mode 100644 index 0000000000..1a2040352c --- /dev/null +++ b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t25.dart @@ -0,0 +1,43 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion Let m and m′ be member signatures with the same name id. Then m +/// is a correct override of m′ iff the following criteria are all satisfied: +/// ... +/// • If m and m′ are both methods or both setters: Let F be the function type +/// of m except that the parameter type is the built-in class Object for each +/// parameter of m which is covariant-by-declaration. Let F′ be the function +/// type of m′. F must then be a subtype of F′. +/// +/// @description Checks that it is a compile-time error if `m` and `m′` are both +/// setters and function type `m` is not a subtype of `m′`. Test `extends` and +/// `on` clauses +/// @author sgrekhov22@gmail.com + +interface class I1 { + void set m(int i) {} +} + +interface class I2 { + void set m(Object i) {} +} + +class C extends I1 implements I2 { + void set m(num i) {} +// ^ +// [analyzer] unspecified +// [cfe] unspecified +} + +mixin M on I2 implements I1 { + void set m(num i) {} +// ^ +// [analyzer] unspecified +// [cfe] unspecified +} + +main() { + print(C); + print(M); +} diff --git a/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t26.dart b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t26.dart new file mode 100644 index 0000000000..4c5ff37561 --- /dev/null +++ b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t26.dart @@ -0,0 +1,35 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion Let m and m′ be member signatures with the same name id. Then m +/// is a correct override of m′ iff the following criteria are all satisfied: +/// ... +/// • If m and m′ are both methods or both setters: Let F be the function type +/// of m except that the parameter type is the built-in class Object for each +/// parameter of m which is covariant-by-declaration. Let F′ be the function +/// type of m′. F must then be a subtype of F′. +/// +/// @description Checks that it is not an error if `m` and `m′` are both setters +/// and function type `m` is a subtype of `m′. Test `extends` and `on` clauses +/// @author sgrekhov22@gmail.com + +interface class I { + void set m1(num v1) {} + void set m2(covariant int v1) {} +} + +class C extends I { + void set m1(covariant int i) {} + void set m2(num i) {} +} + +mixin M on I { + void set m1(covariant int i) {} + void set m2(num i) {} +} + +main() { + print(C); + print(M); +} diff --git a/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t27.dart b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t27.dart new file mode 100644 index 0000000000..7160ca9592 --- /dev/null +++ b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t27.dart @@ -0,0 +1,36 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion Let m and m′ be member signatures with the same name id. Then m +/// is a correct override of m′ iff the following criteria are all satisfied: +/// ... +/// • If m and m′ are both methods or both setters: Let F be the function type +/// of m except that the parameter type is the built-in class Object for each +/// parameter of m which is covariant-by-declaration. Let F′ be the function +/// type of m′. F must then be a subtype of F′. +/// +/// @description Checks that it is not an error if `m` and `m′` are both setters +/// and function type `m` is a subtype of `m′. Test `extends` and `on` clauses +/// @author sgrekhov22@gmail.com + +interface class I1 { + void set m(num v1) {} +} + +interface class I2 { + void set m(covariant int v1) {} +} + +class C extends I1 implements I2 { + void set m(covariant int i) {} +} + +mixin M on I2 implements I1 { + void set m(num i) {} +} + +main() { + print(C); + print(M); +} diff --git a/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t28.dart b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t28.dart new file mode 100644 index 0000000000..a1a41d0a11 --- /dev/null +++ b/Language/Interfaces/Correct_Member_Overrides/correct_member_overrides_A03_t28.dart @@ -0,0 +1,50 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion Let m and m′ be member signatures with the same name id. Then m +/// is a correct override of m′ iff the following criteria are all satisfied: +/// ... +/// • If m and m′ are both methods or both setters: Let F be the function type +/// of m except that the parameter type is the built-in class Object for each +/// parameter of m which is covariant-by-declaration. Let F′ be the function +/// type of m′. F must then be a subtype of F′. +/// +/// @description Checks that it is a compile-time error if `m` and `m′` are both +/// setters and function type `m` is not a subtype of `m′. Test `extends` and +/// `on` clauses +/// @author sgrekhov22@gmail.com + +interface class I { + void set m1(num v1) {} + void set m2(covariant int v1) {} +} + +class C extends I { + void set m1(covariant String i) {} +// ^^ +// [analyzer] unspecified +// [cfe] unspecified + + void set m2(String i) {} +// ^^ +// [analyzer] unspecified +// [cfe] unspecified +} + +mixin M on I { + void set m1(covariant String i) {} +// ^^ +// [analyzer] unspecified +// [cfe] unspecified + + void set m2(String i) {} +// ^^ +// [analyzer] unspecified +// [cfe] unspecified +} + +main() { + print(C); + print(M); +}