Commit 10bc588
Fine. Unify manifest item hierarchy and rename member items.
Refactor the fine-grained manifest model to reduce duplication and make
member representations consistent across top-level and instance scopes.
Key changes
- Replace many ad-hoc item types with shared bases:
- Introduce `ExecutableItem` and `VariableItem`.
- Add concrete items: `ConstructorItem`, `MethodItem`, `GetterItem`,
`SetterItem`, `FieldItem`.
- Make `TopLevelFunctionItem` extend `ExecutableItem` and
`TopLevelVariableItem` extend `VariableItem`.
- Remove `TopLevelItem` and the previous
`InstanceItem{Field,Getter,Setter,Method}Item`,
`InterfaceItemConstructorItem`,
`TopLevel{Getter,Setter}Item`.
- Normalize maps and APIs:
- `LibraryManifest.declaredGetters/declaredSetters` now map to
`GetterItem`/`SetterItem`.
- `exportedIds` aggregates over `Map<LookupName, ManifestItem>` instead
of `TopLevelItem`.
- Matching logic simplifies to presence checks; type guards on the old
item classes are no longer needed.
- Unify function typing:
- Getters and setters now carry a full `functionType` (setters previously
stored only a `valueType`; getters now print return types via
`functionType.returnType`).
- Update printers and ID lookup to the new structure.
- Bump persisted data format: `DATA_VERSION 544 → 545`.
Why
- Consolidates parallel class hierarchies into a single, coherent model.
- Eliminates redundant code paths and special-case handling between
top-level and instance members.
- Makes future additions (e.g., executable flags) consistent by moving
shared properties into `ExecutableItem`.
- Keeps item IDs stable when semantics don’t change while simplifying the
matching and serialization logic.
Change-Id: Ie9c097eae71a2abea874468a740050ae4fe3a570
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448760
Commit-Queue: Konstantin Shcheglov <[email protected]>
Reviewed-by: Johnni Winther <[email protected]>1 parent f14f177 commit 10bc588
File tree
6 files changed
+458
-639
lines changed- pkg/analyzer
- lib/src
- dart/analysis
- fine
- test/src/dart/analysis
6 files changed
+458
-639
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
| 33 | + | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
| 294 | + | |
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | | - | |
| 374 | + | |
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
411 | | - | |
| 411 | + | |
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
| |||
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
432 | | - | |
| 432 | + | |
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
| |||
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
491 | | - | |
| 491 | + | |
492 | 492 | | |
493 | 493 | | |
494 | 494 | | |
| |||
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
512 | | - | |
| 512 | + | |
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
| |||
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
533 | | - | |
| 533 | + | |
534 | 534 | | |
535 | 535 | | |
536 | 536 | | |
| |||
657 | 657 | | |
658 | 658 | | |
659 | 659 | | |
660 | | - | |
| 660 | + | |
661 | 661 | | |
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
665 | | - | |
| 665 | + | |
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
| |||
673 | 673 | | |
674 | 674 | | |
675 | 675 | | |
676 | | - | |
| 676 | + | |
677 | 677 | | |
678 | 678 | | |
679 | 679 | | |
680 | 680 | | |
681 | | - | |
| 681 | + | |
682 | 682 | | |
683 | 683 | | |
684 | 684 | | |
| |||
756 | 756 | | |
757 | 757 | | |
758 | 758 | | |
759 | | - | |
760 | | - | |
| 759 | + | |
| 760 | + | |
761 | 761 | | |
762 | 762 | | |
763 | 763 | | |
| |||
1446 | 1446 | | |
1447 | 1447 | | |
1448 | 1448 | | |
1449 | | - | |
| 1449 | + | |
1450 | 1450 | | |
1451 | 1451 | | |
1452 | 1452 | | |
| |||
1470 | 1470 | | |
1471 | 1471 | | |
1472 | 1472 | | |
1473 | | - | |
| 1473 | + | |
1474 | 1474 | | |
1475 | 1475 | | |
1476 | 1476 | | |
| |||
1494 | 1494 | | |
1495 | 1495 | | |
1496 | 1496 | | |
1497 | | - | |
| 1497 | + | |
1498 | 1498 | | |
1499 | 1499 | | |
1500 | 1500 | | |
| |||
1518 | 1518 | | |
1519 | 1519 | | |
1520 | 1520 | | |
1521 | | - | |
| 1521 | + | |
1522 | 1522 | | |
1523 | 1523 | | |
1524 | 1524 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
364 | | - | |
| 364 | + | |
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
| |||
0 commit comments