aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Annotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-09-15 18:51:55 +0200
committerMartin Odersky <odersky@gmail.com>2016-10-02 16:12:28 +0200
commitbef012d32127e3d256d0ce31e1a2a27f7277f8d8 (patch)
treecae40c2211cfece2bfb0312af732ddfaa47c1ac5 /src/dotty/tools/dotc/core/Annotations.scala
parentce9efda393055060a73509d1c10b8bdd9f2f0136 (diff)
downloaddotty-bef012d32127e3d256d0ce31e1a2a27f7277f8d8.tar.gz
dotty-bef012d32127e3d256d0ce31e1a2a27f7277f8d8.tar.bz2
dotty-bef012d32127e3d256d0ce31e1a2a27f7277f8d8.zip
Move logic from InlineInfo to BodyAnnot
Now that we have BodyAnnot, InlineInfo can be eliminated.
Diffstat (limited to 'src/dotty/tools/dotc/core/Annotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/Annotations.scala6
1 files changed, 5 insertions, 1 deletions
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 {