mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:56:57 +00:00
bfe8aa8d5b
Allows sound-like null safety when running mixed applications in weak mode. This is not a specified option and is only intended to assist large scale migration efforts. Change-Id: Icd0abb0e876d16e719a01e8381eef55a2b511051 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171821 Commit-Queue: Nicholas Shahan <nshahan@google.com> Reviewed-by: Bob Nystrom <rnystrom@google.com> Reviewed-by: Mark Zhou <markzipan@google.com>
18 lines
498 B
Dart
18 lines
498 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
|
|
|
|
// dartdevcOptions=--weak-null-safety-errors
|
|
|
|
import 'package:expect/expect.dart';
|
|
|
|
void main() {
|
|
Expect.throwsTypeError(() => null as int);
|
|
dynamic dynamicNull = null;
|
|
Expect.throwsTypeError(() => fn(dynamicNull));
|
|
}
|
|
|
|
void fn(StringBuffer arg) {}
|