@@ -36,6 +36,81 @@ void f() {
36
36
''' );
37
37
}
38
38
39
+ Future <void > test_assigned_awaitedExpression () async {
40
+ await resolveTestCode (r'''
41
+ Future<int> foo = Future.value(0);
42
+ void f() async {
43
+ final removed = await foo;
44
+ }
45
+ ''' );
46
+ await assertHasFix (r'''
47
+ Future<int> foo = Future.value(0);
48
+ void f() async {
49
+ await foo;
50
+ }
51
+ ''' );
52
+ }
53
+
54
+ Future <void > test_assigned_awaitedInvocation () async {
55
+ await resolveTestCode (r'''
56
+ Future<int> foo() async => 0;
57
+ void f() async {
58
+ final removed = await foo();
59
+ }
60
+ ''' );
61
+ await assertHasFix (r'''
62
+ Future<int> foo() async => 0;
63
+ void f() async {
64
+ await foo();
65
+ }
66
+ ''' );
67
+ }
68
+
69
+ Future <void > test_assigned_doubleParenthesised_awaitedInvocation () async {
70
+ await resolveTestCode (r'''
71
+ Future<int> foo() async => 0;
72
+ void f() async {
73
+ final removed = ((await foo()));
74
+ }
75
+ ''' );
76
+ await assertHasFix (r'''
77
+ Future<int> foo() async => 0;
78
+ void f() async {
79
+ ((await foo()));
80
+ }
81
+ ''' );
82
+ }
83
+
84
+ Future <void > test_assigned_functionExpressionInvocation () async {
85
+ await resolveTestCode (r'''
86
+ void Function() foo() => () {};
87
+ void f() async {
88
+ final removed = foo()();
89
+ }
90
+ ''' );
91
+ await assertHasFix (r'''
92
+ void Function() foo() => () {};
93
+ void f() async {
94
+ foo()();
95
+ }
96
+ ''' );
97
+ }
98
+
99
+ Future <void > test_assigned_functionInvocation () async {
100
+ await resolveTestCode (r'''
101
+ int foo() => 0;
102
+ void f() {
103
+ final removed = foo();
104
+ }
105
+ ''' );
106
+ await assertHasFix (r'''
107
+ int foo() => 0;
108
+ void f() {
109
+ foo();
110
+ }
111
+ ''' );
112
+ }
113
+
39
114
Future <void > test_assigned_inArgumentList () async {
40
115
await resolveTestCode (r'''
41
116
void f() {
@@ -127,6 +202,21 @@ void f(str) {
127
202
''' );
128
203
}
129
204
205
+ Future <void > test_assigned_parenthesised_awaitedInvocation () async {
206
+ await resolveTestCode (r'''
207
+ Future<int> foo() async => 0;
208
+ void f() async {
209
+ final removed = (await foo());
210
+ }
211
+ ''' );
212
+ await assertHasFix (r'''
213
+ Future<int> foo() async => 0;
214
+ void f() async {
215
+ (await foo());
216
+ }
217
+ ''' );
218
+ }
219
+
130
220
Future <void > test_notInFunctionBody () async {
131
221
await resolveTestCode (r'''
132
222
var a = [for (var v = 0;;) 0];
0 commit comments