File tree 1 file changed +3
-7
lines changed
compiler/src/dotty/tools/dotc/sbt
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,9 @@ private class ExtractAPICollector(using Context) extends ThunkHolder {
152
152
*/
153
153
private val seenInlineCache = mutable.HashSet .empty[Symbol ]
154
154
155
- /** This cache is optional, it avoids recomputing hashes of inline "Body" annotations. */
155
+ /** This cache is optional, it avoids recomputing hashes of inline "Body" annotations,
156
+ * e.g. when a concrete inline method is inherited by a subclass.
157
+ */
156
158
private val inlineBodyCache = mutable.HashMap .empty[Symbol , Int ]
157
159
158
160
private val allNonLocalClassesInSrc = new mutable.HashSet [xsbti.api.ClassLike ]
@@ -654,12 +656,6 @@ private class ExtractAPICollector(using Context) extends ThunkHolder {
654
656
// this method need to be recompiled. sbt has no way of tracking method
655
657
// bodies, so we include the hash of the body of the method as part of the
656
658
// signature we send to sbt.
657
- //
658
- // FIXME: The API of a class we send to Zinc includes the signatures of
659
- // inherited methods, which means that we repeatedly compute the hash of
660
- // an inline def in every class that extends its owner. To avoid this we
661
- // could store the hash as an annotation when pickling an inline def
662
- // and retrieve it here instead of computing it on the fly.
663
659
664
660
def hash [U ](inlineOrigin : Symbol ): Int =
665
661
assert(seenInlineCache.add(s)) // will fail if already seen, guarded by treeHash
You can’t perform that action at this time.
0 commit comments