mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:37:12 +00:00
Adjust tests verifying the static type dynamic
Change-Id: Icf229e3877ce646340b6dad1bd49c20110953d44 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169885 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Erik Ernst <eernst@google.com>
This commit is contained in:
parent
5d383959ce
commit
0cf3c37e9e
|
@ -37,10 +37,10 @@ void main() {
|
|||
|
||||
void f5(Function Function<Y>([Y y]) x, dynamic y) {
|
||||
var z = condition ? x : y;
|
||||
// Check that the type is a top type.
|
||||
z.expectStaticType<Exactly<dynamic>>();
|
||||
// Check that the type is `dynamic`.
|
||||
z.unknownMember;
|
||||
// Check that the type of `z` is `dynamic`.
|
||||
Never n = z; // It is `dynamic` or `Never`.
|
||||
z = 0; // It is a supertype of `int`.
|
||||
z = false; // It is a supertype of `bool`.
|
||||
}
|
||||
|
||||
void f6(Never x, Never Function() y) {
|
||||
|
|
|
@ -206,16 +206,16 @@ void main() {
|
|||
|
||||
void f20(dynamic a, FutureOr<void> b) {
|
||||
var x = condition ? a : b;
|
||||
// Verify that the type of `x` is a top type.
|
||||
x.expectStaticType<Exactly<dynamic>>();
|
||||
// Verify that it is `dynamic`.
|
||||
x.unknownMember();
|
||||
// Verify that the type of `x` is `dynamic`.
|
||||
Never n = x; // It is `dynamic` or `Never`.
|
||||
x = 0; // It is a supertype of `int`.
|
||||
x = false; // It is a supertype of `bool`.
|
||||
|
||||
var y = condition ? b : a;
|
||||
// Verify that the type of `y` is a top type.
|
||||
y.expectStaticType<Exactly<dynamic>>();
|
||||
// Verify that it is `dynamic`.
|
||||
y.unknownMember();
|
||||
// Verify that the type of `y` is `dynamic`.
|
||||
n = y;
|
||||
y = 0;
|
||||
y = false;
|
||||
}
|
||||
|
||||
void f21(A a, B b) {
|
||||
|
|
Loading…
Reference in a new issue