-
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.
[front end] Unify methods for making a type nullable.
Previously, there were three methods with slightly different behaviors: - `OperationsCfe.makeNullableInternal`, which simply added `?` to the type. - `OperationsCfe.getNullableType`, which contained special logic for intersection types, and also maintained a cache to minimize the number of type objects that needed to be allocated. - `InferenceVisitorBase.computeNullable`, which also coerced `Never?` to `Null`. With this change, there is just one core implementation, `OperationsCfe.makeNullableInternal`, with all of these behaviors, and then `InferenceVisitorBase.computeNullable` is a convenience method that calls it. Change-Id: I7b6a442d0f3ba66e89d39c50cf240f021344e4aa Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398420 Commit-Queue: Chloe Stefantsova <[email protected]> Auto-Submit: Paul Berry <[email protected]> Reviewed-by: Chloe Stefantsova <[email protected]>
- Loading branch information
1 parent
1baa8ca
commit 3a67a7d
Showing
3 changed files
with
20 additions
and
25 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
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
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