commit | 98f585d092f3fe9306c7b913ae8aa914d2ac20c7 | [log] [tgz] |
---|---|---|
author | Paul Berry <paulberry@google.com> | Fri Feb 10 15:24:08 2023 +0000 |
committer | Commit Queue <dart-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Feb 10 15:24:08 2023 +0000 |
tree | 7b6499d0d4f5ef4a70a8f1d6d153c09eeba85d74 | |
parent | 0bdaafe39593f7b55849515973f1e3bace3c01d7 [diff] |
Flow analysis: fix improper handling of scrutinee EqualityInfo. Previously, we stored an EqualityInfo object representing the scrutinee at the time of entry to the top level of the pattern; then when handling, for example, a relational pattern using `==`, we used that EqualityInfo object to decide how to handle the equality check, *even if we were no longer at the top level of the pattern*. As a result, we would sometimes come to incorrect conclusions about relational patterns inside subpatterns. For example, we would fail to see that `if ((null,) case (== null,))` is a guaranteed match, because when processing the `== null` pattern, we would erroneously use the EqualityInfo for `(null,)` (which is *not* `null`). To solve this, we only store the scrutinee *reference* at the top level of the pattern (this is sufficient to allow us to decide whether or not to promote the scrutinee). When we encounter a pattern like `== null`, we compute the appropriate EqualityInfo directly based on the ExpressionInfo, type, and reference that are appropriate to the current pattern level. Bug: https://github.com/dart-lang/sdk/issues/50419 Change-Id: I4d1bc34fcb2d238e7b69e1b88df50b389410963c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282162 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Paul Berry <paulberry@google.com>
Dart is:
Optimized for UI: Develop with a programming language specialized around the needs of user interface creation.
Productive: Make changes iteratively: use hot reload to see the result instantly in your running app.
Fast on all platforms: Compile to ARM & x64 machine code for mobile, desktop, and backend. Or compile to JavaScript for the web.
Dart's flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:
Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.
Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).
Dart is free and open source.
See LICENSE and PATENT_GRANT.
Visit dart.dev to learn more about the language, tools, and to find codelabs.
Browse pub.dev for more packages and libraries contributed by the community and the Dart team.
Our API reference documentation is published at api.dart.dev, based on the stable release. (We also publish docs from our beta and dev channels, as well as from the primary development branch).
If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.
There are more documents on our wiki.
The easiest way to contribute to Dart is to file issues.
You can also contribute patches, as described in Contributing.