Skip to content

Commit 743c6bb

Browse files
committed
Make Child annotation lazy
Otherwise we get bootstrap problems when trying to compile Child: Completing Predef with the Scala2Unpickler causes Child annotations to be added to parents of case classes. But completing Child would depend on completion of Predef. Making child annotations lazy avoids the cycle.
1 parent 49e537e commit 743c6bb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/dotty/tools/dotc/core/Annotations.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ object Annotations {
9090
ref(TermRef.withSigAndDenot(sym.owner.thisType, sym.name, sym.signature, sym))))
9191

9292
def makeChild(sym: Symbol)(implicit ctx: Context) =
93-
apply(defn.ChildAnnot.typeRef.appliedTo(sym.owner.thisType.select(sym.name, sym)), Nil)
93+
deferred(defn.ChildAnnot,
94+
implicit ctx => New(defn.ChildAnnot.typeRef.appliedTo(sym.owner.thisType.select(sym.name, sym)), Nil))
9495
}
9596

9697
def ThrowsAnnotation(cls: ClassSymbol)(implicit ctx: Context) = {

0 commit comments

Comments
 (0)