Commit 0bf9183
[analyzer] Dot shorthands: Refactoring MethodInvocationResolver to handle dot shorthands.
This is the base preliminary work for resolving dot shorthand invocations. I'll be calling `resolveDotShorthand` from the `Resolver` in a future CL.
Dot shorthand invocation resolution is very similar to normal MethodInvocation resolution, with a few exceptions (like no `target` expression), so it made sense to re-use the logic we had in the `MethodInvocationResolver`.
I refactored `_rewriteAsFunctionExpressionInvocation` heavily to support both dot shorthands and method invocations, which involved pulling out all of the members into parameters.
Most `_report<some error>` methods were refactored to support dot shorthands as well. Half of them called `_setInvalidTypeResolution` and that ended up just being invoked at the call site rather than in the report helper itself.
Dot shorthands has a very basic `DotShorthandInvocationInferrer` in this CL. None of the overrides for a `MethodInvocationInferrer` seemed to apply since we don't have a target.
No tests yet. Tests will be added once I make the next CL that calls this `resolveDotShorthand` entry point.
Bug: #59835
Change-Id: I8ebeb772c30c88b85ae68d805e062accb1d6d17d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421560
Commit-Queue: Kallen Tu <[email protected]>
Reviewed-by: Chloe Stefantsova <[email protected]>1 parent 4ce0cf3 commit 0bf9183
File tree
3 files changed
+340
-73
lines changed- pkg/analyzer/lib/src/dart/resolver
3 files changed
+340
-73
lines changedLines changed: 23 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
158 | 179 | | |
159 | 180 | | |
160 | 181 | | |
161 | 182 | | |
162 | 183 | | |
163 | 184 | | |
164 | 185 | | |
165 | | - | |
| 186 | + | |
166 | 187 | | |
167 | 188 | | |
168 | 189 | | |
| |||
172 | 193 | | |
173 | 194 | | |
174 | 195 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
| 196 | + | |
180 | 197 | | |
181 | 198 | | |
182 | 199 | | |
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
134 | 147 | | |
135 | 148 | | |
136 | 149 | | |
| |||
0 commit comments