commit | 5c904c17f79f2dc2374b4619dad354bd2a293ea0 | [log] [tgz] |
---|---|---|
author | Paul Berry <paulberry@google.com> | Sat Nov 16 14:27:41 2024 +0000 |
committer | Commit Queue <dart-scoped@luci-project-accounts.iam.gserviceaccount.com> | Sat Nov 16 14:27:41 2024 +0000 |
tree | 1d693da03fdba81f28fd5b65d238e38af2e6379d | |
parent | 052c9852c4ff8992c410212ff2e5368bcfac88c0 [diff] |
[mini_types] Add an assertion to verify the runtime type of `PrimaryType`-derived objects. The class hierarchy for `PrimaryType` has several subtypes to represent special types in Dart: - DynamicType (for `dynamic`) - FutureOrType (for `FutureOr<...>`) - InvalidType (for the invalid type) - NeverType (for `Never`) - NullType (for `Null`) - VoidType (for `Void`) When constructing a `PrimaryType` for one of these special types, we need to make sure that the type that's being ultimately constructed is the proper subtype, otherwise algorithms that do `is` tests on the `Type` hierarchy will behave incorrectly. This change adds an assertion to the `PrimaryType` constructor to verify that the appropriate subtype of `Type` is being constructed. Change-Id: I347cc4893da265b35e97636479700a92a8e61541 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395560 Reviewed-by: Kallen Tu <kallentu@google.com> Commit-Queue: 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.