mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 16:59:47 +00:00
872ef163f1
This was a mistake in the shared logic implementation during the implementation of patterns; instead of verifying that the for-in expression is a subtype of `Iterable<dynamic>` (or `Stream<dynamic>` in the case of an `await for`), it merely verifies that it's a subtype of `Iterable<dynamic>?` (or `Stream<dynamic>?`). At some point, the requisite error checking was added to the front end, but not to the analyzer. In an ideal world, the solution would be to remove the error check from the front end and add it to the shared logic; however, doing so is not easy, because what needs to be done is an assignability check (as well as insertion of implicit downcasts and other coercions). The shared logic doesn't currently have a good hook for doing that. So, for now, this CL simply adds the requisite check to the analyzer. I plan to try to find a clean way to share some of this logic in a follow-up CL. Fixes https://github.com/dart-lang/sdk/issues/54671. Change-Id: Ib2fa8bce758dfe12401d85850666674ca1317e3f Bug: https://github.com/dart-lang/sdk/issues/54671 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347360 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Samuel Rawlins <srawlins@google.com> Commit-Queue: Paul Berry <paulberry@google.com> |
||
---|---|---|
.. | ||
co19 | ||
corelib | ||
dartdevc | ||
ffi | ||
language | ||
lib | ||
modular | ||
standalone | ||
web | ||
legacy_status_dart2js.csv | ||
OWNERS | ||
README.md |
This directory contains tests of the language and core library implementations. For more information, see https://github.com/dart-lang/sdk/wiki/Testing.