Skip to content

Commit 9d42245

Browse files
committed
Add documentation
1 parent 65a75df commit 9d42245

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala

+8-1
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,14 @@ class ClassfileParser(
627627
None // ignore malformed annotations
628628
}
629629

630+
/** A completer for attributes
631+
*
632+
* Top-level classes complete attributes eagerly, while members complete azily.
633+
*
634+
* Note that we cannot simply store the bytes of attributes, as the bytes may
635+
* contain references to the constant pool, where the constants are loaded
636+
* lazily.
637+
*/
630638
class AttributeCompleter(sym: Symbol) {
631639
var sig: String = null
632640
var constant: Constant = null
@@ -659,7 +667,6 @@ class ClassfileParser(
659667
}
660668
}
661669

662-
// invariant: `in` and `ctx` should not be captured inside the result function
663670
def parseAttributes(sym: Symbol)(using ctx: Context, in: DataReader): AttributeCompleter = {
664671
val res = new AttributeCompleter(sym)
665672

0 commit comments

Comments
 (0)