Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[analyzer] Changes related to ExecutableElementImpl._parameters.
Now that the type of `ExecutableElementImpl._parameters` has been changed to `List<ParameterElementImpl>`, the type of `ExecutableElementImpl.formalParameters` can also be safely changed from `List<FormalParameterFragment>` to `List<ParameterElementImpl>`, and no longer requires a cast. (This works because `ParameterElementImpl` is a subtype of `FormalParameterFragment`.) Also, in `InheritanceManager3._topMerge`, it isn't necessary to use `toImpl()` to convert `resultType.parameters` to `List<ParameterElementImpl>`, because `resultType` is guaranteed to have been produced by `TypeSystemImpl.topMerge`. Instead, we can change `TypeSystemImpl.topMerge` so that when it produces a `FunctionType`, it always makes their parameter list a `List<ParameterElementImpl>`. (It was already the case that all the parameters in a `FunctionType` produced by `TypeSystemImpl.topMerge` are instances of `ParameterElementImpl`, so this is a straightforward change.) The change to `ExecutableElementImpl.formalParameters` will allow some types in various element model Impl classes to be changed from `DartType` to `TypeImpl`, which will in turn pave the way for changing the analyzer's `DartType` class so that it implements `SharedTypeStructure<TypeImpl>` rather than `SharedTypeStructure<DartType>`. 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: I49153cebed389f549c22d41bebee1f9b85c173d0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404041 Commit-Queue: Paul Berry <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
- Loading branch information