Skip to content

Commit 64b03d1

Browse files
lrhnCommit Queue
authored and
Commit Queue
committed
Add extra documentation to Enum to point to EnumName.
Closes #53164 GitOrigin-RevId: 0c96101 Change-Id: I26391dddde87cdea0cc6ae4a70d04be1a48576f2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319463 Reviewed-by: Johnni Winther <[email protected]> Reviewed-by: Lasse Nielsen <[email protected]> Reviewed-by: Nate Bosch <[email protected]> Commit-Queue: Lasse Nielsen <[email protected]>
1 parent f79ed93 commit 64b03d1

23 files changed

+87
-84
lines changed

pkg/front_end/testcases/enhanced_enums/declared_index.dart.strong.expect

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,58 +33,58 @@ library;
3333
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:26:16: Error: Can't declare a member that conflicts with an inherited one.
3434
// List<String> index() => []; // Error.
3535
// ^^^^^
36-
// sdk/lib/core/enum.dart:101:13: Context: This is the inherited member.
36+
// sdk/lib/core/enum.dart:104:13: Context: This is the inherited member.
3737
// final int index;
3838
// ^^^^^
3939
//
4040
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:64:18: Error: Can't declare a member that conflicts with an inherited one.
4141
// static int get index => 42; // Error.
4242
// ^^^^^
43-
// sdk/lib/core/enum.dart:101:13: Context: This is the inherited member.
43+
// sdk/lib/core/enum.dart:104:13: Context: This is the inherited member.
4444
// final int index;
4545
// ^^^^^
4646
//
4747
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:70:19: Error: Can't declare a member that conflicts with an inherited one.
4848
// static void set index(int value) {} // Error.
4949
// ^^^^^
50-
// sdk/lib/core/enum.dart:101:13: Context: This is the inherited member.
50+
// sdk/lib/core/enum.dart:104:13: Context: This is the inherited member.
5151
// final int index;
5252
// ^^^^^
5353
//
5454
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:74:3: Error: Can't declare a member that conflicts with an inherited one.
5555
// index // Error.
5656
// ^^^^^
57-
// sdk/lib/core/enum.dart:101:13: Context: This is the inherited member.
57+
// sdk/lib/core/enum.dart:104:13: Context: This is the inherited member.
5858
// final int index;
5959
// ^^^^^
6060
//
6161
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:14:14: Error: The return type of the method 'E2.index' is 'String', which does not match the return type, 'int', of the overridden method, '_Enum.index'.
6262
// Change to a subtype of 'int'.
6363
// String get index => "foo"; // Error.
6464
// ^
65-
// sdk/lib/core/enum.dart:101:13: Context: This is the overridden method ('index').
65+
// sdk/lib/core/enum.dart:104:13: Context: This is the overridden method ('index').
6666
// final int index;
6767
// ^
6868
//
6969
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:52:12: Error: The type 'int' of the inherited field '_Enum.index' is not a subtype of the type 'String' of the setter 'E8.index'.
7070
// void set index(String value) {} // Error.
7171
// ^^^^^
72-
// sdk/lib/core/enum.dart:101:13: Context: This is the declaration of the field '_Enum.index'.
72+
// sdk/lib/core/enum.dart:104:13: Context: This is the declaration of the field '_Enum.index'.
7373
// final int index;
7474
// ^^^^^
7575
//
7676
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:58:14: Error: The return type of the method 'E9.index' is 'double', which does not match the return type, 'int', of the overridden method, '_Enum.index'.
7777
// Change to a subtype of 'int'.
7878
// double get index; // Error.
7979
// ^
80-
// sdk/lib/core/enum.dart:101:13: Context: This is the overridden method ('index').
80+
// sdk/lib/core/enum.dart:104:13: Context: This is the overridden method ('index').
8181
// final int index;
8282
// ^
8383
//
8484
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:55:6: Error: The implementation of 'index' in the non-abstract class 'E9' does not conform to its interface.
8585
// enum E9 {
8686
// ^^
87-
// sdk/lib/core/enum.dart:101:13: Context: The return type of the method '_Enum.index' is 'int', which does not match the return type, 'double', of the overridden method, 'E9.index'.
87+
// sdk/lib/core/enum.dart:104:13: Context: The return type of the method '_Enum.index' is 'int', which does not match the return type, 'double', of the overridden method, 'E9.index'.
8888
// Change to a subtype of 'double'.
8989
// final int index;
9090
// ^
@@ -95,7 +95,7 @@ library;
9595
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:87:6: Error: The implementation of 'index' in the non-abstract class 'E14' does not conform to its interface.
9696
// enum E14 implements I14 { element } // Error.
9797
// ^^^
98-
// sdk/lib/core/enum.dart:101:13: Context: The return type of the method '_Enum.index' is 'int', which does not match the return type, 'Never', of the overridden method, 'I14.index'.
98+
// sdk/lib/core/enum.dart:104:13: Context: The return type of the method '_Enum.index' is 'int', which does not match the return type, 'Never', of the overridden method, 'I14.index'.
9999
// Change to a subtype of 'Never'.
100100
// final int index;
101101
// ^

pkg/front_end/testcases/enhanced_enums/declared_index.dart.weak.expect

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,58 +33,58 @@ library;
3333
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:26:16: Error: Can't declare a member that conflicts with an inherited one.
3434
// List<String> index() => []; // Error.
3535
// ^^^^^
36-
// sdk/lib/core/enum.dart:101:13: Context: This is the inherited member.
36+
// sdk/lib/core/enum.dart:104:13: Context: This is the inherited member.
3737
// final int index;
3838
// ^^^^^
3939
//
4040
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:64:18: Error: Can't declare a member that conflicts with an inherited one.
4141
// static int get index => 42; // Error.
4242
// ^^^^^
43-
// sdk/lib/core/enum.dart:101:13: Context: This is the inherited member.
43+
// sdk/lib/core/enum.dart:104:13: Context: This is the inherited member.
4444
// final int index;
4545
// ^^^^^
4646
//
4747
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:70:19: Error: Can't declare a member that conflicts with an inherited one.
4848
// static void set index(int value) {} // Error.
4949
// ^^^^^
50-
// sdk/lib/core/enum.dart:101:13: Context: This is the inherited member.
50+
// sdk/lib/core/enum.dart:104:13: Context: This is the inherited member.
5151
// final int index;
5252
// ^^^^^
5353
//
5454
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:74:3: Error: Can't declare a member that conflicts with an inherited one.
5555
// index // Error.
5656
// ^^^^^
57-
// sdk/lib/core/enum.dart:101:13: Context: This is the inherited member.
57+
// sdk/lib/core/enum.dart:104:13: Context: This is the inherited member.
5858
// final int index;
5959
// ^^^^^
6060
//
6161
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:14:14: Error: The return type of the method 'E2.index' is 'String', which does not match the return type, 'int', of the overridden method, '_Enum.index'.
6262
// Change to a subtype of 'int'.
6363
// String get index => "foo"; // Error.
6464
// ^
65-
// sdk/lib/core/enum.dart:101:13: Context: This is the overridden method ('index').
65+
// sdk/lib/core/enum.dart:104:13: Context: This is the overridden method ('index').
6666
// final int index;
6767
// ^
6868
//
6969
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:52:12: Error: The type 'int' of the inherited field '_Enum.index' is not a subtype of the type 'String' of the setter 'E8.index'.
7070
// void set index(String value) {} // Error.
7171
// ^^^^^
72-
// sdk/lib/core/enum.dart:101:13: Context: This is the declaration of the field '_Enum.index'.
72+
// sdk/lib/core/enum.dart:104:13: Context: This is the declaration of the field '_Enum.index'.
7373
// final int index;
7474
// ^^^^^
7575
//
7676
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:58:14: Error: The return type of the method 'E9.index' is 'double', which does not match the return type, 'int', of the overridden method, '_Enum.index'.
7777
// Change to a subtype of 'int'.
7878
// double get index; // Error.
7979
// ^
80-
// sdk/lib/core/enum.dart:101:13: Context: This is the overridden method ('index').
80+
// sdk/lib/core/enum.dart:104:13: Context: This is the overridden method ('index').
8181
// final int index;
8282
// ^
8383
//
8484
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:55:6: Error: The implementation of 'index' in the non-abstract class 'E9' does not conform to its interface.
8585
// enum E9 {
8686
// ^^
87-
// sdk/lib/core/enum.dart:101:13: Context: The return type of the method '_Enum.index' is 'int', which does not match the return type, 'double', of the overridden method, 'E9.index'.
87+
// sdk/lib/core/enum.dart:104:13: Context: The return type of the method '_Enum.index' is 'int', which does not match the return type, 'double', of the overridden method, 'E9.index'.
8888
// Change to a subtype of 'double'.
8989
// final int index;
9090
// ^
@@ -95,7 +95,7 @@ library;
9595
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:87:6: Error: The implementation of 'index' in the non-abstract class 'E14' does not conform to its interface.
9696
// enum E14 implements I14 { element } // Error.
9797
// ^^^
98-
// sdk/lib/core/enum.dart:101:13: Context: The return type of the method '_Enum.index' is 'int', which does not match the return type, 'Never', of the overridden method, 'I14.index'.
98+
// sdk/lib/core/enum.dart:104:13: Context: The return type of the method '_Enum.index' is 'int', which does not match the return type, 'Never', of the overridden method, 'I14.index'.
9999
// Change to a subtype of 'Never'.
100100
// final int index;
101101
// ^

pkg/front_end/testcases/enhanced_enums/declared_index.dart.weak.modular.expect

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,58 +33,58 @@ library;
3333
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:26:16: Error: Can't declare a member that conflicts with an inherited one.
3434
// List<String> index() => []; // Error.
3535
// ^^^^^
36-
// sdk/lib/core/enum.dart:101:13: Context: This is the inherited member.
36+
// sdk/lib/core/enum.dart:104:13: Context: This is the inherited member.
3737
// final int index;
3838
// ^^^^^
3939
//
4040
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:64:18: Error: Can't declare a member that conflicts with an inherited one.
4141
// static int get index => 42; // Error.
4242
// ^^^^^
43-
// sdk/lib/core/enum.dart:101:13: Context: This is the inherited member.
43+
// sdk/lib/core/enum.dart:104:13: Context: This is the inherited member.
4444
// final int index;
4545
// ^^^^^
4646
//
4747
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:70:19: Error: Can't declare a member that conflicts with an inherited one.
4848
// static void set index(int value) {} // Error.
4949
// ^^^^^
50-
// sdk/lib/core/enum.dart:101:13: Context: This is the inherited member.
50+
// sdk/lib/core/enum.dart:104:13: Context: This is the inherited member.
5151
// final int index;
5252
// ^^^^^
5353
//
5454
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:74:3: Error: Can't declare a member that conflicts with an inherited one.
5555
// index // Error.
5656
// ^^^^^
57-
// sdk/lib/core/enum.dart:101:13: Context: This is the inherited member.
57+
// sdk/lib/core/enum.dart:104:13: Context: This is the inherited member.
5858
// final int index;
5959
// ^^^^^
6060
//
6161
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:14:14: Error: The return type of the method 'E2.index' is 'String', which does not match the return type, 'int', of the overridden method, '_Enum.index'.
6262
// Change to a subtype of 'int'.
6363
// String get index => "foo"; // Error.
6464
// ^
65-
// sdk/lib/core/enum.dart:101:13: Context: This is the overridden method ('index').
65+
// sdk/lib/core/enum.dart:104:13: Context: This is the overridden method ('index').
6666
// final int index;
6767
// ^
6868
//
6969
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:52:12: Error: The type 'int' of the inherited field '_Enum.index' is not a subtype of the type 'String' of the setter 'E8.index'.
7070
// void set index(String value) {} // Error.
7171
// ^^^^^
72-
// sdk/lib/core/enum.dart:101:13: Context: This is the declaration of the field '_Enum.index'.
72+
// sdk/lib/core/enum.dart:104:13: Context: This is the declaration of the field '_Enum.index'.
7373
// final int index;
7474
// ^^^^^
7575
//
7676
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:58:14: Error: The return type of the method 'E9.index' is 'double', which does not match the return type, 'int', of the overridden method, '_Enum.index'.
7777
// Change to a subtype of 'int'.
7878
// double get index; // Error.
7979
// ^
80-
// sdk/lib/core/enum.dart:101:13: Context: This is the overridden method ('index').
80+
// sdk/lib/core/enum.dart:104:13: Context: This is the overridden method ('index').
8181
// final int index;
8282
// ^
8383
//
8484
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:55:6: Error: The implementation of 'index' in the non-abstract class 'E9' does not conform to its interface.
8585
// enum E9 {
8686
// ^^
87-
// sdk/lib/core/enum.dart:101:13: Context: The return type of the method '_Enum.index' is 'int', which does not match the return type, 'double', of the overridden method, 'E9.index'.
87+
// sdk/lib/core/enum.dart:104:13: Context: The return type of the method '_Enum.index' is 'int', which does not match the return type, 'double', of the overridden method, 'E9.index'.
8888
// Change to a subtype of 'double'.
8989
// final int index;
9090
// ^
@@ -95,7 +95,7 @@ library;
9595
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:87:6: Error: The implementation of 'index' in the non-abstract class 'E14' does not conform to its interface.
9696
// enum E14 implements I14 { element } // Error.
9797
// ^^^
98-
// sdk/lib/core/enum.dart:101:13: Context: The return type of the method '_Enum.index' is 'int', which does not match the return type, 'Never', of the overridden method, 'I14.index'.
98+
// sdk/lib/core/enum.dart:104:13: Context: The return type of the method '_Enum.index' is 'int', which does not match the return type, 'Never', of the overridden method, 'I14.index'.
9999
// Change to a subtype of 'Never'.
100100
// final int index;
101101
// ^

pkg/front_end/testcases/enhanced_enums/declared_index.dart.weak.outline.expect

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,58 +33,58 @@ library;
3333
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:26:16: Error: Can't declare a member that conflicts with an inherited one.
3434
// List<String> index() => []; // Error.
3535
// ^^^^^
36-
// sdk/lib/core/enum.dart:101:13: Context: This is the inherited member.
36+
// sdk/lib/core/enum.dart:104:13: Context: This is the inherited member.
3737
// final int index;
3838
// ^^^^^
3939
//
4040
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:64:18: Error: Can't declare a member that conflicts with an inherited one.
4141
// static int get index => 42; // Error.
4242
// ^^^^^
43-
// sdk/lib/core/enum.dart:101:13: Context: This is the inherited member.
43+
// sdk/lib/core/enum.dart:104:13: Context: This is the inherited member.
4444
// final int index;
4545
// ^^^^^
4646
//
4747
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:70:19: Error: Can't declare a member that conflicts with an inherited one.
4848
// static void set index(int value) {} // Error.
4949
// ^^^^^
50-
// sdk/lib/core/enum.dart:101:13: Context: This is the inherited member.
50+
// sdk/lib/core/enum.dart:104:13: Context: This is the inherited member.
5151
// final int index;
5252
// ^^^^^
5353
//
5454
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:74:3: Error: Can't declare a member that conflicts with an inherited one.
5555
// index // Error.
5656
// ^^^^^
57-
// sdk/lib/core/enum.dart:101:13: Context: This is the inherited member.
57+
// sdk/lib/core/enum.dart:104:13: Context: This is the inherited member.
5858
// final int index;
5959
// ^^^^^
6060
//
6161
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:14:14: Error: The return type of the method 'E2.index' is 'String', which does not match the return type, 'int', of the overridden method, '_Enum.index'.
6262
// Change to a subtype of 'int'.
6363
// String get index => "foo"; // Error.
6464
// ^
65-
// sdk/lib/core/enum.dart:101:13: Context: This is the overridden method ('index').
65+
// sdk/lib/core/enum.dart:104:13: Context: This is the overridden method ('index').
6666
// final int index;
6767
// ^
6868
//
6969
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:52:12: Error: The type 'int' of the inherited field '_Enum.index' is not a subtype of the type 'String' of the setter 'E8.index'.
7070
// void set index(String value) {} // Error.
7171
// ^^^^^
72-
// sdk/lib/core/enum.dart:101:13: Context: This is the declaration of the field '_Enum.index'.
72+
// sdk/lib/core/enum.dart:104:13: Context: This is the declaration of the field '_Enum.index'.
7373
// final int index;
7474
// ^^^^^
7575
//
7676
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:58:14: Error: The return type of the method 'E9.index' is 'double', which does not match the return type, 'int', of the overridden method, '_Enum.index'.
7777
// Change to a subtype of 'int'.
7878
// double get index; // Error.
7979
// ^
80-
// sdk/lib/core/enum.dart:101:13: Context: This is the overridden method ('index').
80+
// sdk/lib/core/enum.dart:104:13: Context: This is the overridden method ('index').
8181
// final int index;
8282
// ^
8383
//
8484
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:55:6: Error: The implementation of 'index' in the non-abstract class 'E9' does not conform to its interface.
8585
// enum E9 {
8686
// ^^
87-
// sdk/lib/core/enum.dart:101:13: Context: The return type of the method '_Enum.index' is 'int', which does not match the return type, 'double', of the overridden method, 'E9.index'.
87+
// sdk/lib/core/enum.dart:104:13: Context: The return type of the method '_Enum.index' is 'int', which does not match the return type, 'double', of the overridden method, 'E9.index'.
8888
// Change to a subtype of 'double'.
8989
// final int index;
9090
// ^
@@ -95,7 +95,7 @@ library;
9595
// pkg/front_end/testcases/enhanced_enums/declared_index.dart:87:6: Error: The implementation of 'index' in the non-abstract class 'E14' does not conform to its interface.
9696
// enum E14 implements I14 { element } // Error.
9797
// ^^^
98-
// sdk/lib/core/enum.dart:101:13: Context: The return type of the method '_Enum.index' is 'int', which does not match the return type, 'Never', of the overridden method, 'I14.index'.
98+
// sdk/lib/core/enum.dart:104:13: Context: The return type of the method '_Enum.index' is 'int', which does not match the return type, 'Never', of the overridden method, 'I14.index'.
9999
// Change to a subtype of 'Never'.
100100
// final int index;
101101
// ^

pkg/front_end/testcases/enhanced_enums/enum_as_supertype_error.dart.strong.expect

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ library;
4040
//
4141
// class A extends Enum { // Error.
4242
// ^
43-
// sdk/lib/core/enum.dart:22:11: Context: 'Enum.index' is defined here.
43+
// sdk/lib/core/enum.dart:25:11: Context: 'Enum.index' is defined here.
4444
// int get index;
4545
// ^^^^^
4646
//
@@ -54,7 +54,7 @@ library;
5454
//
5555
// class B implements Enum { // Error.
5656
// ^
57-
// sdk/lib/core/enum.dart:22:11: Context: 'Enum.index' is defined here.
57+
// sdk/lib/core/enum.dart:25:11: Context: 'Enum.index' is defined here.
5858
// int get index;
5959
// ^^^^^
6060
//
@@ -68,7 +68,7 @@ library;
6868
//
6969
// class EnumClass2 extends AbstractEnumClass {} // Error.
7070
// ^^^^^^^^^^
71-
// sdk/lib/core/enum.dart:22:11: Context: 'Enum.index' is defined here.
71+
// sdk/lib/core/enum.dart:25:11: Context: 'Enum.index' is defined here.
7272
// int get index;
7373
// ^^^^^
7474
//
@@ -82,7 +82,7 @@ library;
8282
//
8383
// class EnumClass3 extends AbstractEnumClass2 {} // Error.
8484
// ^^^^^^^^^^
85-
// sdk/lib/core/enum.dart:22:11: Context: 'Enum.index' is defined here.
85+
// sdk/lib/core/enum.dart:25:11: Context: 'Enum.index' is defined here.
8686
// int get index;
8787
// ^^^^^
8888
//

pkg/front_end/testcases/enhanced_enums/enum_as_supertype_error.dart.strong.transformed.expect

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ library;
4040
//
4141
// class A extends Enum { // Error.
4242
// ^
43-
// sdk/lib/core/enum.dart:22:11: Context: 'Enum.index' is defined here.
43+
// sdk/lib/core/enum.dart:25:11: Context: 'Enum.index' is defined here.
4444
// int get index;
4545
// ^^^^^
4646
//
@@ -54,7 +54,7 @@ library;
5454
//
5555
// class B implements Enum { // Error.
5656
// ^
57-
// sdk/lib/core/enum.dart:22:11: Context: 'Enum.index' is defined here.
57+
// sdk/lib/core/enum.dart:25:11: Context: 'Enum.index' is defined here.
5858
// int get index;
5959
// ^^^^^
6060
//
@@ -68,7 +68,7 @@ library;
6868
//
6969
// class EnumClass2 extends AbstractEnumClass {} // Error.
7070
// ^^^^^^^^^^
71-
// sdk/lib/core/enum.dart:22:11: Context: 'Enum.index' is defined here.
71+
// sdk/lib/core/enum.dart:25:11: Context: 'Enum.index' is defined here.
7272
// int get index;
7373
// ^^^^^
7474
//
@@ -82,7 +82,7 @@ library;
8282
//
8383
// class EnumClass3 extends AbstractEnumClass2 {} // Error.
8484
// ^^^^^^^^^^
85-
// sdk/lib/core/enum.dart:22:11: Context: 'Enum.index' is defined here.
85+
// sdk/lib/core/enum.dart:25:11: Context: 'Enum.index' is defined here.
8686
// int get index;
8787
// ^^^^^
8888
//

0 commit comments

Comments
 (0)