-
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.
Remove unnecessary state restoring logic from analyzer constraint gen…
…eration. The `TypeConstraintGatherer` methods `trySubtypeMatch`, `_functionType`, `_functionType0`, and `_recordType` have the convention that if they do not find a match, they leave the set of gathered constraints in the same state it was in at the time of the call. The shared methods they invoke (`performSubtypeConstraintGenerationForFutureOr`, `performSubtypeConstraintGenerationForTypeDeclarationTypes`, and `performSubtypeConstraintGenerationForFunctionTypes`) all follow the same convention. Because of this convention, much of the logic in `trySubtypeMatch` for restoring the state of gathered constraints was actually redundant; this CL removes the redundant logic. It also adds some comments to try to clarify the calling conventions. Change-Id: Ie11e4bc3edd3249191a09d9b93ae5844d5bf511c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388664 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Paul Berry <[email protected]>
- Loading branch information
1 parent
7d506c0
commit be17dc6
Showing
1 changed file
with
30 additions
and
16 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