Skip to content

Commit 99a8b20

Browse files
committed
clarify comment about inlineBodyCache
1 parent 33ebf01 commit 99a8b20

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala

+4-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@ private class ExtractAPICollector(using Context) extends ThunkHolder {
152152
*/
153153
private val seenInlineCache = mutable.HashSet.empty[Symbol]
154154

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+
*/
156158
private val inlineBodyCache = mutable.HashMap.empty[Symbol, Int]
157159

158160
private val allNonLocalClassesInSrc = new mutable.HashSet[xsbti.api.ClassLike]
@@ -658,6 +660,7 @@ private class ExtractAPICollector(using Context) extends ThunkHolder {
658660
// FIXME: The API of a class we send to Zinc includes the signatures of
659661
// inherited methods, which means that we repeatedly compute the hash of
660662
// an inline def in every class that extends its owner. To avoid this we
663+
// currently cache it in `inlineBodyCache`. Alternatively, we
661664
// could store the hash as an annotation when pickling an inline def
662665
// and retrieve it here instead of computing it on the fly.
663666

0 commit comments

Comments
 (0)