mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 01:21:07 +00:00
3a7eeb6315
Change-Id: If3912d75c5f89a741299b2fae4299d01ac928eec Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170424 Reviewed-by: Lasse R.H. Nielsen <lrn@google.com> Reviewed-by: Michael Thomsen <mit@google.com> Reviewed-by: Mayank Patke <fishythefish@google.com> Commit-Queue: Erik Ernst <eernst@google.com>
20 lines
487 B
Dart
20 lines
487 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 "package:expect/expect.dart";
|
|
|
|
final bool strong = () {
|
|
try {
|
|
int i = null as dynamic;
|
|
return false;
|
|
} catch (e) {
|
|
return true;
|
|
}
|
|
}();
|
|
|
|
void main() {
|
|
Expect.equals(strong, hasSoundNullSafety);
|
|
Expect.equals(!strong, hasUnsoundNullSafety);
|
|
}
|