Commit adcc212
[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]>1 parent 8bbe6fb commit adcc212
File tree
4 files changed
+12
-16
lines changed- pkg/analyzer/lib/src/dart/element
4 files changed
+12
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3679 | 3679 | | |
3680 | 3680 | | |
3681 | 3681 | | |
3682 | | - | |
3683 | | - | |
| 3682 | + | |
3684 | 3683 | | |
3685 | 3684 | | |
3686 | 3685 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | 208 | | |
220 | 209 | | |
221 | 210 | | |
| |||
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1142 | 1142 | | |
1143 | 1143 | | |
1144 | 1144 | | |
1145 | | - | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
1146 | 1150 | | |
1147 | 1151 | | |
1148 | 1152 | | |
| |||
1160 | 1164 | | |
1161 | 1165 | | |
1162 | 1166 | | |
1163 | | - | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
1164 | 1172 | | |
1165 | 1173 | | |
1166 | 1174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| |||
0 commit comments