mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
207953f367
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>
16 lines
590 B
Dart
16 lines
590 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-strong
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
main() {
|
|
var shortDuration = Duration(milliseconds: 5);
|
|
|
|
Expect.isTrue(Future<int?>.delayed(shortDuration) is Future);
|
|
// In strong mode not passing a computation will throw when the type argument
|
|
// passed is not nullable.
|
|
Expect.throwsArgumentError(() => Future<int>.delayed(shortDuration));
|
|
}
|