Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: #47196 Change-Id: I7f10156330994d31e44384fa952dd88385e2628d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214043 Reviewed-by: Nate Bosch <[email protected]> Commit-Queue: Lasse R.H. Nielsen <[email protected]>
- Loading branch information