Commit bb7106a
[analyzer] Change DartType to implement SharedTypeStructure<TypeImpl>.
The type `DartType` is changed so that instead of implementing
`SharedTypeStructure<DartType>`, it implements
`SharedTypeStructure<TypeImpl>`.
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.
To ensure that this change doesn't expose the private `TypeImpl` type
through the analyzer public API, an abstract override of
`SharedTypeStructure.isStructurallyEqualTo` is added to `DartType`,
with a parameter type of `DartType`. (Without the override, the
parameter type would be `SharedTypeStructure<TypeImpl>`.) This method
has been marked as deprecated, because it was not intentional for it
to be exposed through the analyzer's public API.
The following types, derived from `DartType`, require similar changes
due to the fact that they implement shared types that are subtypes of
`SharedTypeStructure`:
- `DynamicTypeImpl` now implements
`SharedDynamicTypeStructure<TypeImpl>`.
- `FunctionTypeImpl` now implements
`SharedFunctionTypeStructure<TypeImpl, TypeParameterElementImpl2,
FormalParameterElementOrMember>`.
- `InvalidTypeImpl` now implements
`SharedInvalidTypeStructure<TypeImpl>`.
- `NullTypeImpl` now implements `SharedNullTypeStructure<TypeImpl>`.
- `RecordTypeImpl` now implements
`SharedRecordTypeStructure<TypeImpl>`.
- `VoidTypeImpl` now implements `SharedVoidTypeStructure<TypeImpl>`.
- `UnknownInferredType` now implements
`SharedUnknownTypeStructure<TypeImpl>`.
Since the type `SharedNamedFunctionParameterStructure` is tightly
integrated with `SharedFunctionTypeStructure`,
`FormalParameterElementOrMember` must also be changed, so that it
implements `SharedNamedFunctionParameterStructure<TypeImpl>` rather
than `SharedNamedFunctionParameterStructure<DartType>`.
Similarly, `TypeParameterElementImpl2` must be changed so that it
implements `SharedTypeParameterStructure<TypeImpl>` rather than
`SharedTypeParameterStructure<DartType>`.
Follow-up CLs will change other uses of shared generic types so that
they supply a type argument of `TypeImpl` rather than `DartType`.
Change-Id: Ib36491056d46e4cd706c0dc2b85adc5314cb0b2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403944
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Paul Berry <[email protected]>1 parent dc709bb commit bb7106a
File tree
5 files changed
+38
-24
lines changed- pkg/analyzer/lib
- dart/element
- src/dart/element
5 files changed
+38
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
211 | 221 | | |
212 | 222 | | |
213 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4631 | 4631 | | |
4632 | 4632 | | |
4633 | 4633 | | |
4634 | | - | |
| 4634 | + | |
4635 | 4635 | | |
4636 | 4636 | | |
4637 | 4637 | | |
| |||
4676 | 4676 | | |
4677 | 4677 | | |
4678 | 4678 | | |
4679 | | - | |
| 4679 | + | |
4680 | 4680 | | |
4681 | 4681 | | |
4682 | 4682 | | |
| |||
11317 | 11317 | | |
11318 | 11318 | | |
11319 | 11319 | | |
11320 | | - | |
| 11320 | + | |
11321 | 11321 | | |
11322 | 11322 | | |
11323 | 11323 | | |
| |||
11343 | 11343 | | |
11344 | 11344 | | |
11345 | 11345 | | |
11346 | | - | |
| 11346 | + | |
| 11347 | + | |
| 11348 | + | |
11347 | 11349 | | |
11348 | 11350 | | |
11349 | 11351 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1261 | 1261 | | |
1262 | 1262 | | |
1263 | 1263 | | |
1264 | | - | |
| 1264 | + | |
1265 | 1265 | | |
1266 | 1266 | | |
1267 | 1267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
| |||
232 | 234 | | |
233 | 235 | | |
234 | 236 | | |
235 | | - | |
| 237 | + | |
236 | 238 | | |
237 | 239 | | |
238 | | - | |
| 240 | + | |
239 | 241 | | |
240 | 242 | | |
241 | 243 | | |
| |||
1207 | 1209 | | |
1208 | 1210 | | |
1209 | 1211 | | |
1210 | | - | |
| 1212 | + | |
1211 | 1213 | | |
1212 | 1214 | | |
1213 | 1215 | | |
| |||
1332 | 1334 | | |
1333 | 1335 | | |
1334 | 1336 | | |
1335 | | - | |
| 1337 | + | |
1336 | 1338 | | |
1337 | 1339 | | |
1338 | 1340 | | |
| |||
1358 | 1360 | | |
1359 | 1361 | | |
1360 | 1362 | | |
1361 | | - | |
| 1363 | + | |
1362 | 1364 | | |
1363 | 1365 | | |
1364 | 1366 | | |
| |||
1369 | 1371 | | |
1370 | 1372 | | |
1371 | 1373 | | |
1372 | | - | |
| 1374 | + | |
1373 | 1375 | | |
1374 | 1376 | | |
1375 | 1377 | | |
| |||
1418 | 1420 | | |
1419 | 1421 | | |
1420 | 1422 | | |
1421 | | - | |
| 1423 | + | |
1422 | 1424 | | |
1423 | 1425 | | |
1424 | 1426 | | |
1425 | 1427 | | |
1426 | 1428 | | |
1427 | | - | |
| 1429 | + | |
1428 | 1430 | | |
1429 | 1431 | | |
1430 | 1432 | | |
| |||
1525 | 1527 | | |
1526 | 1528 | | |
1527 | 1529 | | |
1528 | | - | |
| 1530 | + | |
1529 | 1531 | | |
1530 | 1532 | | |
1531 | 1533 | | |
| |||
1538 | 1540 | | |
1539 | 1541 | | |
1540 | 1542 | | |
1541 | | - | |
| 1543 | + | |
1542 | 1544 | | |
1543 | 1545 | | |
1544 | 1546 | | |
| |||
1846 | 1848 | | |
1847 | 1849 | | |
1848 | 1850 | | |
1849 | | - | |
| 1851 | + | |
1850 | 1852 | | |
1851 | 1853 | | |
1852 | 1854 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
0 commit comments