Commit 79ccbcf
committed
Defer cleanup of emptied and synthetic declarations during invalidation
After incremental invalidation, declarations can lose all their
definitions. Previously these were removed immediately, destroying
accumulated state (singleton links, member lists) the resolver needs.
This defers TODO cleanup to after resolution via `cleanup_stale_todos()`.
TODOs created speculatively by `create_todo_for_parent` are marked via
`defer_todo_cleanup` and evaluated post-resolution — promoted TODOs and
those with members are kept, empty stubs are removed.
Singleton classes use references and members as "still in use" signals
in `has_no_backing_definitions`, preventing premature removal when
callers (Foo.new) or class-level state (@x = 1) still exist.
Other empty declarations (from file deletion or member removal) cascade
immediately via the invalidation worklist.1 parent ff3eaf4 commit 79ccbcf
3 files changed
Lines changed: 595 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
165 | 173 | | |
166 | 174 | | |
167 | 175 | | |
| |||
327 | 335 | | |
328 | 336 | | |
329 | 337 | | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
330 | 346 | | |
331 | 347 | | |
332 | 348 | | |
| |||
345 | 361 | | |
346 | 362 | | |
347 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
348 | 377 | | |
349 | 378 | | |
350 | 379 | | |
| |||
466 | 495 | | |
467 | 496 | | |
468 | 497 | | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
469 | 504 | | |
470 | 505 | | |
471 | 506 | | |
| |||
578 | 613 | | |
579 | 614 | | |
580 | 615 | | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
581 | 620 | | |
582 | 621 | | |
583 | 622 | | |
| |||
0 commit comments