Skip to content

Commit 570121b

Browse files
committed
Implement review recommendations
1 parent 330cc6b commit 570121b

File tree

5 files changed

+103
-234
lines changed

5 files changed

+103
-234
lines changed

LanguageFeatures/Augmentation-libraries/augmenting_constructors_A01_t02.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
///
99
/// @description Checks that it is a compile-time error if the signature of the
1010
/// constructor augmentation does not match the original constructor. Test wrong
11-
/// number of optional parameters.
11+
/// number of optional positional parameters.
1212
/// @author [email protected]
1313
1414
// SharedOptions=--enable-experiment=augmentations

LanguageFeatures/Augmentation-libraries/augmenting_constructors_A01_t10.dart

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,26 @@ String _log = "";
1919

2020
class C {
2121
var x, y;
22-
C(int x, [final int y = 0]);
23-
C.foo({required int x, final int y = 0});
24-
C.bar(int x, [final int y = 0]);
25-
C.baz({required int x, final int y = 0});
22+
C(int x, [int y = 0]);
23+
C.foo({required int x, int y = 0});
24+
C.bar(int x, [int y = 0]);
25+
C.baz({required int x, int y = 0});
2626
}
2727

2828
augment class C {
29-
augment C(this.x, [final this.y]) {
29+
augment C(this.x, [this.y]) {
3030
x.expectStaticType<Exactly<int>>();
3131
y.expectStaticType<Exactly<int>>();
3232
}
33-
augment C.foo({required this.x, final this.y}) {
33+
augment C.foo({required this.x, this.y}) {
3434
x.expectStaticType<Exactly<int>>();
3535
y.expectStaticType<Exactly<int>>();
3636
}
37-
augment C.bar(x, [final y]) : x = x, y = y {
37+
augment C.bar(x, [y]) : x = x, y = y {
3838
x.expectStaticType<Exactly<int>>();
3939
y.expectStaticType<Exactly<int>>();
4040
}
41-
augment C.baz({required x, final y}) : x = x, y = y {
41+
augment C.baz({required x, y}) : x = x, y = y {
4242
x.expectStaticType<Exactly<int>>();
4343
y.expectStaticType<Exactly<int>>();
4444
}
@@ -47,45 +47,45 @@ augment class C {
4747
enum E {
4848
e0(1), e1.foo(x: 1), e2.bar(1), e3.baz(x: 1);
4949
final x, y;
50-
const E(int this.x, [final int this.y = 0]);
51-
const E.foo({required int this.x, final int this.y = 0});
52-
const E.bar(int x, [final int y = 0]): x = x, y = y;
53-
const E.baz({required int x, final int y = 0}): x = x, y = y;
50+
const E(int this.x, [int this.y = 0]);
51+
const E.foo({required int this.x, int this.y = 0});
52+
const E.bar(int x, [int y = 0]): x = x, y = y;
53+
const E.baz({required int x, int y = 0}): x = x, y = y;
5454
}
5555

5656
augment enum E {
5757
;
58-
augment const E(x, [final y]);
59-
augment const E.foo({required x, final y});
60-
augment const E.bar(x, [final y]);
61-
augment const E.baz({required x, final y});
58+
augment const E(x, [y]);
59+
augment const E.foo({required x, y});
60+
augment const E.bar(x, [y]);
61+
augment const E.baz({required x, y});
6262
}
6363

6464

6565
extension type ET(int x) {
66-
ET.foo(int x, [final int y = 0]);
67-
ET.bar({required int x, final int y = 0});
68-
ET.baz(int x, [final int y = 0]);
69-
ET.qux({required int x, final int y = 0});
66+
ET.foo(int x, [int y = 0]);
67+
ET.bar({required int x, int y = 0});
68+
ET.baz(int x, [int y = 0]);
69+
ET.qux({required int x, int y = 0});
7070
}
7171

7272
augment extension type ET {
73-
augment ET.foo(this.x, [final y]) {
73+
augment ET.foo(this.x, [y]) {
7474
x.expectStaticType<Exactly<int>>();
7575
y.expectStaticType<Exactly<int>>();
7676
_log = "Augmented: $x, $y";
7777
}
78-
augment ET.bar({required this.x, final y}) {
78+
augment ET.bar({required this.x, y}) {
7979
x.expectStaticType<Exactly<int>>();
8080
y.expectStaticType<Exactly<int>>();
8181
_log = "Augmented: $x, $y";
8282
}
83-
augment ET.baz(x, [final y]) : x = x {
83+
augment ET.baz(x, [y]) : x = x {
8484
x.expectStaticType<Exactly<int>>();
8585
y.expectStaticType<Exactly<int>>();
8686
_log = "Augmented: $x, $y";
8787
}
88-
augment ET.qux({required x, final y}) : x = x {
88+
augment ET.qux({required x, y}) : x = x {
8989
x.expectStaticType<Exactly<int>>();
9090
y.expectStaticType<Exactly<int>>();
9191
_log = "Augmented: $x, $y";

LanguageFeatures/Augmentation-libraries/augmenting_constructors_A01_t11.dart

Lines changed: 0 additions & 119 deletions
This file was deleted.

0 commit comments

Comments
 (0)