Skip to content

Commit a369992

Browse files
eernstgcommit-bot@chromium.org
authored andcommitted
Corrections in lub tests, cf. flutter#43717, flutter#43720.
The tests least_upper_bound_{futureor,function}_test.dart are corrected: The expected least upper bound was changed in one case in each test, because the case matches a rule earlier in the ruleset, so the new rules are not used in these cases. Change-Id: I1f5f303ccde10af6084771a90d92d81d636909d6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166635 Reviewed-by: Lasse R.H. Nielsen <lrn@google.com> Commit-Queue: Erik Ernst <eernst@google.com>
1 parent 16ea842 commit a369992

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

tests/language/least_upper_bound/least_upper_bound_function_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ void main() {
4646

4747
void f7(Function(Function) x, Null y) {
4848
var z = condition ? x : y;
49-
z.expectStaticType<Exactly<Object?>>();
49+
z.expectStaticType<Exactly<Function(Function)?>>();
5050
}
5151
}

tests/language/least_upper_bound/least_upper_bound_futureor_test.dart

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -206,20 +206,16 @@ void main() {
206206

207207
void f20(dynamic a, FutureOr<void> b) {
208208
var x = condition ? a : b;
209-
x.expectStaticType<Exactly<FutureOr<void>>>();
210-
if (x is Future) throw 0;
211-
/**/ x.toString();
212-
// ^
213-
// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
214-
// [cfe] This expression has type 'void' and can't be used.
209+
// Verify that the type of `x` is a top type.
210+
x.expectStaticType<Exactly<dynamic>>();
211+
// Verify that it is `dynamic`.
212+
x.unknownMember();
215213

216214
var y = condition ? b : a;
217-
y.expectStaticType<Exactly<FutureOr<void>>>();
218-
if (y is Future) throw 0;
219-
/**/ y.toString();
220-
// ^
221-
// [analyzer] COMPILE_TIME_ERROR.USE_OF_VOID_RESULT
222-
// [cfe] This expression has type 'void' and can't be used.
215+
// Verify that the type of `y` is a top type.
216+
y.expectStaticType<Exactly<dynamic>>();
217+
// Verify that it is `dynamic`.
218+
y.unknownMember();
223219
}
224220

225221
void f21(A a, B b) {

0 commit comments

Comments
 (0)