dart-sdk/tests
Paul Berry 872ef163f1 Fix missing analyzer error when pattern for-in iterable is nullable.
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>
2024-01-24 22:23:09 +00:00
..
co19 [co19] Roll co19 to b5126f0bd51ea0819df8d5c362574f951a564940 2024-01-12 11:23:39 +00:00
corelib Update tests to pass in web/production mode. 2024-01-08 17:21:29 +00:00
dartdevc [ddc] Removing some references to "legacy" DDC modules. 2024-01-24 21:22:25 +00:00
ffi Revert "[ffi]: Remove pointer elementAt method." 2024-01-22 12:20:48 +00:00
language Fix missing analyzer error when pattern for-in iterable is nullable. 2024-01-24 22:23:09 +00:00
lib [dart2wasm] Add concrete box and symbol for JSBoxedDartObject 2024-01-23 23:39:49 +00:00
modular [tests] Add repro for cross module constant 2023-11-13 22:21:40 +00:00
standalone [io] Add tests for failure to resolve a path using FileSystemEntity.resolveSymbolicLinks. 2024-01-19 01:47:49 +00:00
web [dart2wasm] Introduce a --minify flag to dart2wasm that uses "minified:Class<cid>" for class names 2024-01-24 09:10:15 +00:00
legacy_status_dart2js.csv Spelling tests 2022-12-19 12:56:47 +00:00
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.