Commit 13cc09a
Fine. Make ancestry helpers ID-tracked; tie members to container
Reclassify `thisOrAncestorMatching()` and `thisOrAncestorOfType()` from
`@trackedDirectlyOpaque` to `@trackedIncludedInId` and remove opaque
`recordOpaqueApiUse` calls. Using these helpers now contributes to the
consumer’s dependency graph through element IDs rather than an opaque
side channel.
Augment manifest matching so members explicitly depend on their
enclosing container:
- Pass the enclosing `instanceElement`/`interfaceElement` into member
matchers (fields, getters, setters, methods) and constructors.
- Add the container element to the `MatchContext` when a member matches.
This fixes a bug where a member’s ID could stay stable when only the
container changed (e.g., superclass/mixin changes), leading to stale
reuse. When the container’s ID changes, affected members now get new
IDs, ensuring correct invalidation for ancestry-sensitive queries.
Trade-off: this increases invalidation fan-out—more member IDs will
change when a container changes—which can reduce cache reuse and
increase rebuild work. We accept this for correctness; if needed we can
mitigate by making member–container dependencies more selective (e.g.,
depending only on container “interface” stamps that affect member
signatures).
Change-Id: I01259590dc30d9735f0f436a59130d07d0bd9681
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/450101
Reviewed-by: Johnni Winther <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>1 parent 8678711 commit 13cc09a
File tree
3 files changed
+992
-47
lines changed- pkg/analyzer
- lib/src
- dart/element
- fine
- test/src/dart/analysis
3 files changed
+992
-47
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1935 | 1935 | | |
1936 | 1936 | | |
1937 | 1937 | | |
1938 | | - | |
| 1938 | + | |
1939 | 1939 | | |
1940 | | - | |
1941 | | - | |
1942 | | - | |
1943 | | - | |
1944 | 1940 | | |
1945 | 1941 | | |
1946 | 1942 | | |
| |||
1956 | 1952 | | |
1957 | 1953 | | |
1958 | 1954 | | |
1959 | | - | |
| 1955 | + | |
1960 | 1956 | | |
1961 | | - | |
1962 | 1957 | | |
1963 | 1958 | | |
1964 | 1959 | | |
| |||
4603 | 4598 | | |
4604 | 4599 | | |
4605 | 4600 | | |
4606 | | - | |
| 4601 | + | |
4607 | 4602 | | |
4608 | | - | |
4609 | | - | |
4610 | | - | |
4611 | | - | |
4612 | 4603 | | |
4613 | 4604 | | |
4614 | 4605 | | |
| |||
4623 | 4614 | | |
4624 | 4615 | | |
4625 | 4616 | | |
4626 | | - | |
| 4617 | + | |
4627 | 4618 | | |
4628 | | - | |
4629 | 4619 | | |
4630 | 4620 | | |
4631 | 4621 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1432 | 1432 | | |
1433 | 1433 | | |
1434 | 1434 | | |
| 1435 | + | |
1435 | 1436 | | |
1436 | 1437 | | |
1437 | 1438 | | |
| |||
1442 | 1443 | | |
1443 | 1444 | | |
1444 | 1445 | | |
| 1446 | + | |
1445 | 1447 | | |
1446 | 1448 | | |
1447 | 1449 | | |
| |||
1452 | 1454 | | |
1453 | 1455 | | |
1454 | 1456 | | |
| 1457 | + | |
1455 | 1458 | | |
1456 | 1459 | | |
1457 | 1460 | | |
| |||
1462 | 1465 | | |
1463 | 1466 | | |
1464 | 1467 | | |
| 1468 | + | |
1465 | 1469 | | |
1466 | 1470 | | |
1467 | 1471 | | |
| |||
1472 | 1476 | | |
1473 | 1477 | | |
1474 | 1478 | | |
| 1479 | + | |
1475 | 1480 | | |
1476 | 1481 | | |
1477 | 1482 | | |
| |||
1491 | 1496 | | |
1492 | 1497 | | |
1493 | 1498 | | |
| 1499 | + | |
1494 | 1500 | | |
1495 | 1501 | | |
1496 | 1502 | | |
1497 | 1503 | | |
1498 | 1504 | | |
| 1505 | + | |
1499 | 1506 | | |
1500 | 1507 | | |
1501 | 1508 | | |
| |||
1515 | 1522 | | |
1516 | 1523 | | |
1517 | 1524 | | |
| 1525 | + | |
1518 | 1526 | | |
1519 | 1527 | | |
1520 | 1528 | | |
1521 | 1529 | | |
1522 | 1530 | | |
| 1531 | + | |
1523 | 1532 | | |
1524 | 1533 | | |
1525 | 1534 | | |
| |||
1539 | 1548 | | |
1540 | 1549 | | |
1541 | 1550 | | |
| 1551 | + | |
1542 | 1552 | | |
1543 | 1553 | | |
1544 | 1554 | | |
1545 | 1555 | | |
1546 | 1556 | | |
| 1557 | + | |
1547 | 1558 | | |
1548 | 1559 | | |
1549 | 1560 | | |
| |||
1563 | 1574 | | |
1564 | 1575 | | |
1565 | 1576 | | |
| 1577 | + | |
1566 | 1578 | | |
1567 | 1579 | | |
1568 | 1580 | | |
1569 | 1581 | | |
1570 | 1582 | | |
| 1583 | + | |
1571 | 1584 | | |
1572 | 1585 | | |
1573 | 1586 | | |
| |||
1587 | 1600 | | |
1588 | 1601 | | |
1589 | 1602 | | |
| 1603 | + | |
1590 | 1604 | | |
1591 | 1605 | | |
1592 | 1606 | | |
| |||
1598 | 1612 | | |
1599 | 1613 | | |
1600 | 1614 | | |
| 1615 | + | |
1601 | 1616 | | |
1602 | 1617 | | |
1603 | 1618 | | |
| |||
0 commit comments