Skip to content

Commit a128e65

Browse files
authored
Fixes #2390. Fix tests according to the new method/setter rules (#2392)
1 parent c3c55b0 commit a128e65

3 files changed

+11
-17
lines changed

LanguageFeatures/Extension-types/static_analysis_extension_types_A03_t05.dart

+2-8
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,11 @@ extension type ET2(int id) {
4242
}
4343

4444
extension type ET3(int id) implements I1 {
45-
void set n(int i) {}
46-
// ^
47-
// [analyzer] unspecified
48-
// [cfe] unspecified
45+
void set n(int i) {} // no error, the setter precludes the method
4946
}
5047

5148
extension type ET4(int id) implements I2 {
52-
int n() => 2;
53-
// ^
54-
// [analyzer] unspecified
55-
// [cfe] unspecified
49+
int n() => 2; // no error, the method precludes the setter
5650
}
5751

5852
main() {

LanguageFeatures/Extension-types/static_analysis_extension_types_A30_t02.dart

+1-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ extension type ET1(int id) {
3030
}
3131

3232
extension type ET2(int id) implements I {
33-
int get x => 42;
34-
// ^
35-
// [analyzer] unspecified
36-
// [cfe] unspecified
33+
int get x => 42; // no error, the getter precludes the setter
3734
}
3835

3936
main() {

LanguageFeatures/Extension-types/superinterfaces_of_extension_type_A05_t08.dart

+8-5
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,21 @@
3333
/// redeclared by a getter, or vice versa.
3434
///
3535
/// @description Checks that it is a compile-time error if an extension type
36-
/// declaration `DV` declares a member that conflicts with an inherited one
36+
/// declaration `DV` includes a member that conflicts with other ones
3737
/// @author [email protected]
3838
3939
// SharedOptions=--enable-experiment=inline-class
4040

41-
extension type V(int id) {
42-
external int id2;
41+
extension type V1(int id) {
42+
external int id2; // id2 here declares a setter with conflicts with V2.id2()
4343
}
4444

45-
extension type ET(int id) implements V {
45+
extension type V2(int id) {
4646
int id2() => id;
47-
// ^^^
47+
}
48+
49+
extension type ET(int id) implements V1, V2 {
50+
// ^^
4851
// [analyzer] unspecified
4952
// [cfe] unspecified
5053
}

0 commit comments

Comments
 (0)