dart-sdk/tests/corelib_2/null_closurized_method_tostring_test.dart
Stephen Adams 53b730791a Test for #48322
Change-Id: I878a288ac5932de8c83546df91038dcf54cd9039
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231845
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-02-16 01:32:14 +00:00

19 lines
489 B
Dart

// Copyright (c) 2022, 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";
// The closurized methods of `null` have working `toString()` methods.
// See #48322.
void main() {
check(null.toString);
check(null.noSuchMethod);
}
void check(Object o) {
final s = o.toString();
Expect.notEquals("", s);
}