Add some test cases to function_type_bounds_test.dart.

Change-Id: Iba7bb2b1e2a1f63a228154be2a9ce23d46da54cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341382
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This commit is contained in:
Paul Berry 2023-12-14 17:33:17 +00:00 committed by Commit Queue
parent 2d01bf3779
commit f08dab3b11

View file

@ -12,4 +12,18 @@ main() {
// void fn<T extends int>() is void Function<T extends int>()
Expect.isTrue(fnWithNonNullIntBound is fnTypeWithNonNullIntBound);
// void fn<T extends Object?>() is void Function<T extends Object?>()
Expect.isTrue(fnWithNullableObjectBound is fnTypeWithNullableObjectBound);
// void fn<T extends int?>() is void Function<T extends int?>()
Expect.isTrue(fnWithNullableIntBound is fnTypeWithNullableIntBound);
// void fn<T extends Object?>() is! void Function<T extends Object>()
// (except when using unsound null safety)
Expect.equals(hasUnsoundNullSafety,
fnWithNullableObjectBound is fnTypeWithNonNullObjectBound);
// void fn<T extends Object>() is! void Function<T extends Object?>()
// (except when using unsound null safety)
Expect.equals(hasUnsoundNullSafety,
fnWithNonNullObjectBound is fnTypeWithNullableObjectBound);
}