Commit 4810117
committed
Defer cleanup of emptied and synthetic declarations during invalidation
During invalidation, declarations can lose all of their backing definitions before the resolver has a chance to recreate them. Queue those declarations for post-resolution cleanup instead of removing them immediately.
The cleanup pass now preserves TODO namespaces that still have members, reaps orphaned singleton classes once their members and attached references are gone, re-queues owners that become empty when a child is removed, and loops resolution until cleanup stops producing more work.
Also fix remove_document_data so deleting an attached reference like Foo.new detaches the stale singleton reference even if the attached name was already unresolved, and add incremental regression tests for the affected delete, delete-and-readd, and compact-notation cleanup cases.1 parent f610861 commit 4810117
3 files changed
Lines changed: 605 additions & 28 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 | | |
| |||
345 | 353 | | |
346 | 354 | | |
347 | 355 | | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
348 | 377 | | |
349 | 378 | | |
350 | 379 | | |
| |||
578 | 607 | | |
579 | 608 | | |
580 | 609 | | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
581 | 614 | | |
582 | 615 | | |
583 | 616 | | |
| |||
0 commit comments