-
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.
[analyzer] Use StatementImpl when interfacing with shared code
Change the analyzer's use of the following generic types so that it supplies the type parameter `StatementImpl` instead of `Statement` as the type of AST node it uses to represent statements: - `FlowAnalysis` - `TypeAnalyzerErrors` This required adjusting some `is` tests to test against concrete statement types instead of abstract public interface types (e.g. `is SwitchStatementImpl` instead of `is SwitchStatement`). In one place (in `FlowAnalysisHelper.getLabelTarget`) I changed an if-test to a switch statement so that I could use pattern matching to avoid type casts entirely. In some places, I was able to avoid adding casts by changing method parameters to accept concrete statement types instead of abstract public interface types. This required adding the `covariant` keyword to some methods. This is part of a larger arc of work to change the analyzer's use of the shared code so that the type parameters it supplies are not part of the analyzer public API. See #59763. Change-Id: I8910184ff71ccb97b52e5d44fbf0b6bddd6e273b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403180 Commit-Queue: Paul Berry <paulberry@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
- Loading branch information
1 parent
1c4d7e1
commit 8191171
Showing
3 changed files
with
27 additions
and
23 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