From 6bf7768e4e2e604f93f27efacf28d076d97ac951 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 10 Sep 2016 12:15:11 +0200 Subject: Refactoring for registering InlineInfo Now it's done on the symbol directly rather than its inline annotation. This simplifies client code and keeps the implementaion how inline infos should be assocated with inline methods open. --- src/dotty/tools/dotc/typer/Typer.scala | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/dotty/tools/dotc/typer/Typer.scala') diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index c8362522d..d1a2ad5c2 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -1172,10 +1172,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit val rhs1 = typedExpr(ddef.rhs, tpt1.tpe)(rhsCtx) // Overwrite inline body to make sure it is not evaluated twice - sym.getAnnotation(defn.InlineAnnot) match { - case Some(ann) => Inliner.attachInlineInfo(ann, ctx => rhs1) - case _ => - } + if (sym.hasAnnotation(defn.InlineAnnot)) + Inliner.registerInlineInfo(sym, ctx => rhs1) if (sym.isAnonymousFunction) { // If we define an anonymous function, make sure the return type does not -- cgit v1.2.3