From 743c6bb43334c70581f99c849b14ecab5981544e Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 15 May 2015 16:48:29 +0200 Subject: [PATCH] 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. --- src/dotty/tools/dotc/core/Annotations.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dotty/tools/dotc/core/Annotations.scala b/src/dotty/tools/dotc/core/Annotations.scala index 0dc7113f29ac..6d0fba33708d 100644 --- a/src/dotty/tools/dotc/core/Annotations.scala +++ b/src/dotty/tools/dotc/core/Annotations.scala @@ -90,7 +90,8 @@ object Annotations { ref(TermRef.withSigAndDenot(sym.owner.thisType, sym.name, sym.signature, sym)))) def makeChild(sym: Symbol)(implicit ctx: Context) = - apply(defn.ChildAnnot.typeRef.appliedTo(sym.owner.thisType.select(sym.name, sym)), Nil) + deferred(defn.ChildAnnot, + implicit ctx => New(defn.ChildAnnot.typeRef.appliedTo(sym.owner.thisType.select(sym.name, sym)), Nil)) } def ThrowsAnnotation(cls: ClassSymbol)(implicit ctx: Context) = {