Commit 751fe13
[analyzer] Use TypeImpl for type annotation types.
The types of `TypeAnnotationImpl.type`, and the fields that override
it, are changed from `DartType?` to `TypeImpl?`. Also, the type of
`TypeAnnotationExtension.typeOrThrow` is changed from `DartType` to
`TypeImpl`.
To reduce the number of casts that need to be added, the following
changes are made in parallel:
- An additional extension `TypeAnnotationImplExtension.typeOrThrow` is
added; this has the same behavior as
`TypeAnnotationExtension.typeOrThrow`, but it doesn't require a type
cast.
- Some field types, getter types, method return types, and method
parameter types are changed to `Impl` types in the following
classes:
- `AstRewriter`
- `EraseNonJSInteropTypes`
- `ExtensionTypeErasure`
- `FreshTypeParameters`
- `FullInvocationInferrer`
- `FunctionExpressionInvocationResolver`
- `FunctionReferenceResolver`
- `FunctionTypeBuilder`
- `InstanceCreationInferrer`
- `InvocationExpressionInferrer`
- `InvocationInferrer`
- `NamedTypeBuilder`
- `NamedTypeResolver`
- `ResolutionReader`
- `TypeAliasElementImpl`
- `TypeAliasElementImpl2`
- `TypeImpl`
- `TypeParameterElementImpl`
- `TypeSystemImpl`
There is no change to the analyzer public API.
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: I7f753508b53f6744677fd18f66858d70eb974093
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405221
Commit-Queue: Paul Berry <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>1 parent cf09edd commit 751fe13
File tree
25 files changed
+132
-85
lines changed- pkg
- analysis_server/lib/src/services/correction/dart
- analyzer/lib/src
- dart
- ast
- element
- resolver
- error
- generated
- summary2
- linter/lib/src/rules
25 files changed
+132
-85
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | | - | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9022 | 9022 | | |
9023 | 9023 | | |
9024 | 9024 | | |
9025 | | - | |
| 9025 | + | |
9026 | 9026 | | |
9027 | 9027 | | |
9028 | 9028 | | |
| |||
12546 | 12546 | | |
12547 | 12547 | | |
12548 | 12548 | | |
12549 | | - | |
| 12549 | + | |
12550 | 12550 | | |
12551 | 12551 | | |
12552 | 12552 | | |
| |||
14860 | 14860 | | |
14861 | 14861 | | |
14862 | 14862 | | |
14863 | | - | |
| 14863 | + | |
14864 | 14864 | | |
14865 | 14865 | | |
14866 | 14866 | | |
| |||
17834 | 17834 | | |
17835 | 17835 | | |
17836 | 17836 | | |
17837 | | - | |
| 17837 | + | |
| 17838 | + | |
| 17839 | + | |
| 17840 | + | |
17838 | 17841 | | |
17839 | 17842 | | |
17840 | 17843 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
380 | 389 | | |
381 | 390 | | |
382 | 391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10859 | 10859 | | |
10860 | 10860 | | |
10861 | 10861 | | |
10862 | | - | |
| 10862 | + | |
10863 | 10863 | | |
10864 | 10864 | | |
10865 | 10865 | | |
| |||
10878 | 10878 | | |
10879 | 10879 | | |
10880 | 10880 | | |
10881 | | - | |
| 10881 | + | |
10882 | 10882 | | |
10883 | 10883 | | |
10884 | 10884 | | |
10885 | 10885 | | |
10886 | 10886 | | |
10887 | | - | |
| 10887 | + | |
| 10888 | + | |
| 10889 | + | |
10888 | 10890 | | |
10889 | 10891 | | |
10890 | 10892 | | |
| |||
10910 | 10912 | | |
10911 | 10913 | | |
10912 | 10914 | | |
10913 | | - | |
| 10915 | + | |
10914 | 10916 | | |
10915 | 10917 | | |
10916 | 10918 | | |
| |||
11157 | 11159 | | |
11158 | 11160 | | |
11159 | 11161 | | |
11160 | | - | |
| 11162 | + | |
11161 | 11163 | | |
11162 | 11164 | | |
11163 | 11165 | | |
| |||
11347 | 11349 | | |
11348 | 11350 | | |
11349 | 11351 | | |
11350 | | - | |
| 11352 | + | |
11351 | 11353 | | |
11352 | 11354 | | |
11353 | 11355 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1536 | 1536 | | |
1537 | 1537 | | |
1538 | 1538 | | |
1539 | | - | |
| 1539 | + | |
1540 | 1540 | | |
1541 | 1541 | | |
1542 | 1542 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
700 | 702 | | |
701 | 703 | | |
702 | 704 | | |
703 | | - | |
704 | | - | |
| 705 | + | |
| 706 | + | |
705 | 707 | | |
706 | 708 | | |
707 | 709 | | |
| |||
746 | 748 | | |
747 | 749 | | |
748 | 750 | | |
749 | | - | |
750 | | - | |
| 751 | + | |
| 752 | + | |
751 | 753 | | |
752 | 754 | | |
753 | 755 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
142 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
143 | 147 | | |
144 | 148 | | |
145 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
80 | | - | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
635 | 636 | | |
636 | 637 | | |
637 | 638 | | |
638 | | - | |
| 639 | + | |
639 | 640 | | |
640 | 641 | | |
641 | 642 | | |
| |||
0 commit comments