Commit 082dc6f
authored
Make incremental compilation aware of synthesized mirrors (#18310)
A product mirror needs to be resynthesized if any class parameter
changes, and
a sum mirror needs to be resynthesized if any child of the sealed type
changes,
but previously this did not reliably work because the dependency
recording in
ExtractDependencies was unaware of mirrors.
Instead of making ExtractDependencies aware of mirrors, we solve this by
directly recording the dependencies when the mirror is synthesized, this
way we
can be sure to always correctly invalidate users of mirrors, even if the
synthesized mirror type is not present in the AST at phase
ExtractDependencies.
This is the first time that we record dependencies outside of the
ExtractDependencies phase, in the future we should see if we can extend
this
mechanism to record more dependencies during typechecking to make
incremental
compilation more robust (e.g. by keeping track of symbols looked up by
macros).
Eventually, we might even want to completely get rid of the
ExtractDependencies
phase and record all dependencies on the fly if it turns out to be
faster.File tree
22 files changed
+413
-195
lines changed- compiler/src/dotty/tools/dotc
- sbt
- typer
- sbt-test/source-dependencies
- mirror-product
- changes
- mirror-sum
- changes
- useOptimizedSealed
- changes
- project
22 files changed
+413
-195
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
76 | 81 | | |
77 | 82 | | |
78 | 83 | | |
79 | 84 | | |
80 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
81 | 90 | | |
82 | 91 | | |
83 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
679 | | - | |
680 | | - | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
681 | 686 | | |
682 | 687 | | |
683 | | - | |
| 688 | + | |
684 | 689 | | |
685 | 690 | | |
686 | 691 | | |
| |||
0 commit comments