From bef012d32127e3d256d0ce31e1a2a27f7277f8d8 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 15 Sep 2016 18:51:55 +0200 Subject: Move logic from InlineInfo to BodyAnnot Now that we have BodyAnnot, InlineInfo can be eliminated. --- src/dotty/tools/dotc/core/Annotations.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/core/Annotations.scala') diff --git a/src/dotty/tools/dotc/core/Annotations.scala b/src/dotty/tools/dotc/core/Annotations.scala index fde41ef76..0e8e5a1f0 100644 --- a/src/dotty/tools/dotc/core/Annotations.scala +++ b/src/dotty/tools/dotc/core/Annotations.scala @@ -26,6 +26,8 @@ object Annotations { } def argumentConstant(i: Int)(implicit ctx: Context): Option[Constant] = for (ConstantType(c) <- argument(i) map (_.tpe)) yield c + + def ensureCompleted(implicit ctx: Context): Unit = tree } case class ConcreteAnnotation(t: Tree) extends Annotation { @@ -44,13 +46,14 @@ object Annotations { /** An annotation indicating the body of a right-hand side, * typically of an inline method. Treated specially in - * pickling/unpickling and treecopies + * pickling/unpickling and TypeTreeMaps */ abstract class BodyAnnotation extends Annotation { override def symbol(implicit ctx: Context) = defn.BodyAnnot override def derivedAnnotation(tree: Tree)(implicit ctx: Context) = if (tree eq this.tree) this else ConcreteBodyAnnotation(tree) override def arguments(implicit ctx: Context) = Nil + override def ensureCompleted(implicit ctx: Context) = () } case class ConcreteBodyAnnotation(body: Tree) extends BodyAnnotation { @@ -68,6 +71,7 @@ object Annotations { } myBody } + def isEvaluated = evaluated } object Annotation { -- cgit v1.2.3