-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mini_types] Add an assertion to verify the runtime type of `PrimaryT…
…ype`-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>
- Loading branch information
1 parent
052c985
commit 5c904c1
Showing
1 changed file
with
39 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters