Commit 5fcc131
committed
Incremental compilation: handle constructor proxies
I noticed that repeatedly runnning `sbt compile` in dotty lead to the
same files being compiled over and over even though nothing changed,
running `sbt "debug; compile"` revealed messages like this:
[debug] Invalidating '${BASE}/compiler/target/scala-3.0.0-RC1/classes/dotty/tools/dotc/typer/Namer.class' because could not find class dotty.tools.dotc.typer.Namer$ on the classpath.
Indeed, Namer does not have a companion object so there's no
`Namer$.class` file, but sbt was looking for one because we registered
such a companion with `ctx.sbtCallback.binaryDependency`, this happened
because we created a fake companion object for the purpose of holding
constructor proxies (fake apply methods that forward to a constructor).
The fix is to special-case such references, just like we already
special-cased references to the fake companion of Java classes.1 parent 3c837f9 commit 5fcc131
1 file changed
+13
-4
lines changedLines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
157 | 166 | | |
158 | 167 | | |
159 | 168 | | |
| |||
0 commit comments