3af367cfd9
When we moved to make errors non-nullable in the async API, I added legacy tests, but not NNBD tests because it is a static error in NNBD. However, we've since started testing that null is caught dynamically when flowing into those APIs from legacy code. So this migrates those tests over. Change-Id: I8002bacb45e947ef8c93dca10c7c1fd41afaa696 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152614 Auto-Submit: Bob Nystrom <rnystrom@google.com> Commit-Queue: Bob Nystrom <rnystrom@google.com> Commit-Queue: Nicholas Shahan <nshahan@google.com> Reviewed-by: Nicholas Shahan <nshahan@google.com>
15 lines
395 B
Dart
15 lines
395 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.
|
|
|
|
import 'dart:async';
|
|
|
|
import 'package:expect/expect.dart';
|
|
|
|
main() {
|
|
// The error cannot be null.
|
|
Expect.throwsNullCheckError(() {
|
|
Future.error(null as dynamic);
|
|
});
|
|
}
|