commit | 5eacff3ab8f9b6418c86d71e9eacc5bcb7b6ce32 | [log] [tgz] |
---|---|---|
author | Paul Berry <paulberry@google.com> | Tue Oct 08 05:44:20 2024 +0000 |
committer | Commit Queue <dart-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Oct 08 05:44:20 2024 +0000 |
tree | e8ef49a361efe779db9dcc7cf5b9798c17c1778c | |
parent | b4d5272d99b16a78dd17eab1b96205a2ee5aae47 [diff] |
Make type variable constraint generation conventions uniform. This CL changes the CFE's TypeConstraintGatherer._isNullabilityAwareSubtypeMatch method so that it is responsible for restoring the constraint state if there is no match, making it consistent with the contraint gathering methods in the analyzer and _fe_analyzer_shared. This made it possible to remove much of the calls to state restoring logic that _isNullabilityAwareSubtypeMatch previously had to do after making recursive calls to itself, as well as a lot of state restoring logic in _fe_analyzer_shared. It also made it possible to eliminate _tryNullabilityAwareSubtypeMatch from the CFE (since _isNullabilityAwareSubtypeMatch now has the same behavior). Making this change now should hopefully simplify the remaining steps in sharing type variable constraint generation logic, since it will no longer be necessary to adjust state restoring logic when moving code between the CFE and _fe_analyzer_shared. I also took the liberty of rewriting some of the documentation comments to try to clarify the new conventions. In the process I also discovered several instances of unnecessary state restoring logic in the analyzer; I'll make a separate CL to clean those up (and adjust the analyzer documentation too). Change-Id: If74c8be06f1d53f61d109e5ea2a8526d5cbcd347 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388265 Commit-Queue: Chloe Stefantsova <cstefantsova@google.com> Reviewed-by: Chloe Stefantsova <cstefantsova@google.com> Auto-Submit: Paul Berry <paulberry@google.com>
Dart is:
Approachable: Develop with a strongly typed programming language that is consistent, concise, and offers modern language features like null safety and patterns.
Portable: Compile to ARM, x64, or RISC-V machine code for mobile, desktop, and backend. Compile to JavaScript or WebAssembly for the web.
Productive: Make changes iteratively: use hot reload to see the result instantly in your running app. Diagnose app issues using DevTools.
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 in our repo at docs.
The easiest way to contribute to Dart is to file issues.
You can also contribute patches, as described in Contributing.
Future plans for Dart are included in the combined Dart and Flutter roadmap on the Flutter wiki.