Skip to content

Commit 358602e

Browse files
committed
Try using flagsUNSAFE (thanks @smarter)
1 parent 940b2f1 commit 358602e

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

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

+6-9
Original file line numberDiff line numberDiff line change
@@ -628,19 +628,11 @@ class ClassfileParser(
628628
}
629629

630630
class AttributeCompleter(sym: Symbol) {
631-
var codeAttribute: Boolean = false
632631
var sig: String = null
633632
var constant: Constant = null
634633
var exceptions: List[NameOrString] = Nil
635634
var annotations: List[Annotation] = Nil
636635
def complete(tp: Type, isVarargs: Boolean = false)(using Context): Type = {
637-
// flag test will trigger completion and cycles, thus have to be lazy
638-
if (codeAttribute && sym.owner.isAllOf(Flags.JavaInterface)) {
639-
sym.resetFlag(Flags.Deferred)
640-
sym.owner.resetFlag(Flags.PureInterface)
641-
report.log(s"$sym in ${sym.owner} is a java 8+ default method.")
642-
}
643-
644636
val updatedType =
645637
if sig == null then tp
646638
else {
@@ -715,7 +707,12 @@ class ClassfileParser(
715707

716708
case tpnme.CodeATTR =>
717709
in.skip(attrLen)
718-
res.codeAttribute = true
710+
// flag test will trigger completion and cycles, thus have to be lazy
711+
if (sym.owner.flagsUNSAFE.isAllOf(Flags.JavaInterface)) {
712+
sym.resetFlag(Flags.Deferred)
713+
sym.owner.resetFlag(Flags.PureInterface)
714+
report.log(s"$sym in ${sym.owner} is a java 8+ default method.")
715+
}
719716

720717
case _ =>
721718
}

0 commit comments

Comments
 (0)