Commit 2936dca
[analyzer] Dot Shorthands: Add DotShorthandConstructorInvocation AST and resolve constructors.
When we resolve a DotShorthandInvocation, it can either be a method invocation or a constructor invocation. This CL adds a `DotShorthandConstructorInvocation` node to represent the shorthand equivalent of an `InstanceCreationExpression` (without the extra bulk of needing a synthetic `NamedType`), and adds the resolution logic.
Test added in the form of unit test and existing language tests.
Bug: #59835
Change-Id: I6966ce549f2b079efc0b002fba41bc31a90871c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/422544
Reviewed-by: Paul Berry <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Kallen Tu <[email protected]>1 parent 157a0f0 commit 2936dca
File tree
17 files changed
+462
-33
lines changed- pkg/analyzer
- lib
- dart/ast
- src
- dart
- ast
- resolver
- generated
- lint
- test_utilities
- test/src
- dart/resolution
- summary
17 files changed
+462
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
| 376 | + | |
376 | 377 | | |
377 | 378 | | |
378 | 379 | | |
| |||
715 | 716 | | |
716 | 717 | | |
717 | 718 | | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
718 | 722 | | |
719 | 723 | | |
720 | 724 | | |
| |||
1897 | 1901 | | |
1898 | 1902 | | |
1899 | 1903 | | |
| 1904 | + | |
1900 | 1905 | | |
1901 | 1906 | | |
1902 | 1907 | | |
| |||
2095 | 2100 | | |
2096 | 2101 | | |
2097 | 2102 | | |
| 2103 | + | |
2098 | 2104 | | |
2099 | 2105 | | |
2100 | 2106 | | |
| |||
2271 | 2277 | | |
2272 | 2278 | | |
2273 | 2279 | | |
| 2280 | + | |
2274 | 2281 | | |
2275 | 2282 | | |
2276 | 2283 | | |
| |||
2447 | 2454 | | |
2448 | 2455 | | |
2449 | 2456 | | |
| 2457 | + | |
2450 | 2458 | | |
2451 | 2459 | | |
2452 | 2460 | | |
| |||
2624 | 2632 | | |
2625 | 2633 | | |
2626 | 2634 | | |
| 2635 | + | |
2627 | 2636 | | |
2628 | 2637 | | |
2629 | 2638 | | |
| |||
2800 | 2809 | | |
2801 | 2810 | | |
2802 | 2811 | | |
| 2812 | + | |
2803 | 2813 | | |
2804 | 2814 | | |
2805 | 2815 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
282 | 287 | | |
283 | 288 | | |
284 | 289 | | |
| |||
1043 | 1048 | | |
1044 | 1049 | | |
1045 | 1050 | | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
1046 | 1058 | | |
1047 | 1059 | | |
1048 | 1060 | | |
| |||
1985 | 1997 | | |
1986 | 1998 | | |
1987 | 1999 | | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
1988 | 2005 | | |
1989 | 2006 | | |
1990 | 2007 | | |
| |||
2534 | 2551 | | |
2535 | 2552 | | |
2536 | 2553 | | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
2537 | 2559 | | |
2538 | 2560 | | |
2539 | 2561 | | |
| |||
3299 | 3321 | | |
3300 | 3322 | | |
3301 | 3323 | | |
| 3324 | + | |
| 3325 | + | |
| 3326 | + | |
| 3327 | + | |
| 3328 | + | |
| 3329 | + | |
| 3330 | + | |
| 3331 | + | |
| 3332 | + | |
3302 | 3333 | | |
3303 | 3334 | | |
3304 | 3335 | | |
| |||
4521 | 4552 | | |
4522 | 4553 | | |
4523 | 4554 | | |
| 4555 | + | |
| 4556 | + | |
| 4557 | + | |
| 4558 | + | |
| 4559 | + | |
4524 | 4560 | | |
4525 | 4561 | | |
4526 | 4562 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1233 | 1233 | | |
1234 | 1234 | | |
1235 | 1235 | | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
1236 | 1239 | | |
1237 | 1240 | | |
1238 | 1241 | | |
| |||
5192 | 5195 | | |
5193 | 5196 | | |
5194 | 5197 | | |
| 5198 | + | |
| 5199 | + | |
| 5200 | + | |
| 5201 | + | |
| 5202 | + | |
| 5203 | + | |
| 5204 | + | |
| 5205 | + | |
| 5206 | + | |
| 5207 | + | |
| 5208 | + | |
| 5209 | + | |
| 5210 | + | |
| 5211 | + | |
| 5212 | + | |
| 5213 | + | |
| 5214 | + | |
| 5215 | + | |
| 5216 | + | |
| 5217 | + | |
| 5218 | + | |
| 5219 | + | |
| 5220 | + | |
| 5221 | + | |
| 5222 | + | |
| 5223 | + | |
| 5224 | + | |
| 5225 | + | |
| 5226 | + | |
| 5227 | + | |
| 5228 | + | |
| 5229 | + | |
| 5230 | + | |
| 5231 | + | |
| 5232 | + | |
| 5233 | + | |
| 5234 | + | |
| 5235 | + | |
| 5236 | + | |
| 5237 | + | |
| 5238 | + | |
| 5239 | + | |
| 5240 | + | |
| 5241 | + | |
| 5242 | + | |
| 5243 | + | |
| 5244 | + | |
| 5245 | + | |
| 5246 | + | |
| 5247 | + | |
| 5248 | + | |
| 5249 | + | |
| 5250 | + | |
| 5251 | + | |
| 5252 | + | |
| 5253 | + | |
| 5254 | + | |
| 5255 | + | |
| 5256 | + | |
| 5257 | + | |
| 5258 | + | |
| 5259 | + | |
| 5260 | + | |
| 5261 | + | |
| 5262 | + | |
| 5263 | + | |
| 5264 | + | |
| 5265 | + | |
| 5266 | + | |
| 5267 | + | |
| 5268 | + | |
| 5269 | + | |
| 5270 | + | |
| 5271 | + | |
| 5272 | + | |
| 5273 | + | |
| 5274 | + | |
| 5275 | + | |
| 5276 | + | |
| 5277 | + | |
| 5278 | + | |
| 5279 | + | |
| 5280 | + | |
| 5281 | + | |
| 5282 | + | |
5195 | 5283 | | |
5196 | 5284 | | |
5197 | 5285 | | |
| |||
8488 | 8576 | | |
8489 | 8577 | | |
8490 | 8578 | | |
8491 | | - | |
| 8579 | + | |
8492 | 8580 | | |
8493 | 8581 | | |
8494 | 8582 | | |
| |||
10562 | 10650 | | |
10563 | 10651 | | |
10564 | 10652 | | |
10565 | | - | |
10566 | | - | |
| 10653 | + | |
| 10654 | + | |
10567 | 10655 | | |
10568 | 10656 | | |
10569 | 10657 | | |
| |||
15345 | 15433 | | |
15346 | 15434 | | |
15347 | 15435 | | |
| 15436 | + | |
| 15437 | + | |
| 15438 | + | |
| 15439 | + | |
| 15440 | + | |
| 15441 | + | |
15348 | 15442 | | |
15349 | 15443 | | |
15350 | 15444 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
351 | 360 | | |
352 | 361 | | |
353 | 362 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
Lines changed: 46 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
52 | 95 | | |
53 | 96 | | |
54 | 97 | | |
| |||
58 | 101 | | |
59 | 102 | | |
60 | 103 | | |
61 | | - | |
| 104 | + | |
| 105 | + | |
62 | 106 | | |
63 | 107 | | |
64 | 108 | | |
| |||
0 commit comments