@@ -568,25 +568,14 @@ class Namer { typer: Typer =>
568568 val cls = typedAheadAnnotation(annotTree)
569569 val ann = Annotation .deferred(cls, implicit ctx => typedAnnotation(annotTree))
570570 denot.addAnnotation(ann)
571- if (cls == defn.InlineAnnot ) {
572- hasInlineAnnot = true
573- addInlineInfo(denot, original)
574- }
575- }
576- if (! hasInlineAnnot && denot.is(InlineMethod )) {
577- // create a @inline annotation. Currently, the inlining trigger
578- // is really the annotation, not the flag. This is done so that
579- // we can still compile inline methods from Scala2x. Once we stop
580- // being compatible with Scala2 we should revise the logic to
581- // be based on the flag. Then creating a separate annotation becomes unnecessary.
582- denot.addAnnotation(Annotation (defn.InlineAnnot ))
583- addInlineInfo(denot, original)
571+ if (cls == defn.InlineAnnot && denot.is(Method , butNot = Accessor ))
572+ denot.setFlag(Inline )
584573 }
585574 case _ =>
586575 }
587576
588- private def addInlineInfo (denot : SymDenotation , original : untpd. Tree ) = original match {
589- case original : untpd.DefDef =>
577+ private def addInlineInfo (denot : SymDenotation ) = original match {
578+ case original : untpd.DefDef if denot.isInlineMethod =>
590579 Inliner .registerInlineInfo(
591580 denot,
592581 implicit ctx => typedAheadExpr(original).asInstanceOf [tpd.DefDef ].rhs
@@ -599,6 +588,7 @@ class Namer { typer: Typer =>
599588 */
600589 def completeInCreationContext (denot : SymDenotation ): Unit = {
601590 addAnnotations(denot)
591+ addInlineInfo(denot)
602592 denot.info = typeSig(denot.symbol)
603593 Checking .checkWellFormed(denot.symbol)
604594 }
0 commit comments