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>
This commit is contained in:
Stephen Adams 2022-02-16 01:32:14 +00:00 committed by Commit Bot
parent 3a3738c6fb
commit 53b730791a
2 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,18 @@
// 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);
}

View file

@ -0,0 +1,18 @@
// 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);
}