dart-sdk/tests/lib/async/regress154963234_weak_test.dart
Nicholas Shahan 207953f367 [tests] Add regression tests for internal issue
We already landed a workaround for b/154963234 as
https://dart-review.googlesource.com/c/sdk/+/144815. Adding
these tests to ensure the followup fix doesn't break it again.

Change-Id: Ic021c2b3f0e5b3cd12ae0286ac5146c71f380aa2
Bug: b/154963234
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144988
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-04-28 23:49:43 +00:00

17 lines
591 B
Dart

// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Requirements=nnbd-weak
import "package:expect/expect.dart";
main() {
var shortDuration = Duration(milliseconds: 5);
Expect.isTrue(Future<int?>.delayed(shortDuration) is Future);
// In weak mode passing computation is not required because any type passed as
// the type argument can be nullable.
Expect.isTrue(Future<int>.delayed(shortDuration) is Future);
}