dart-sdk/sdk
Lasse R.H. Nielsen 651d6e076b Add null-unsoundness check to print's object.toString() result.
This makes it an *earlier* error if a `toString` method returns `null`
when passed to `print`, possibly a new error if the underlying platform's
print implementation let `null` through.
Returning `null` is something `toString` was never supposed to do,
and with null safety, it's enforced by the type system,
so only pre-null-safety legacy code can actually return `null`.

Makes the error message from `NotNullableError` not assume a parameter,
so it can be used in more places.

Bug: https://github.com/dart-lang/sdk/issues/47196
Change-Id: I7f10156330994d31e44384fa952dd88385e2628d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214043
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-09-23 15:36:23 +00:00
..
bin Deprecate top level pub. 2021-08-24 08:34:58 +00:00
lib Add null-unsoundness check to print's object.toString() result. 2021-09-23 15:36:23 +00:00
api_readme.md Update the API docs readme 2020-01-16 21:23:09 +00:00
BUILD.gn Deprecate top level pub. 2021-08-24 08:34:58 +00:00