aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Namer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-11-07 17:05:14 +0100
committerMartin Odersky <odersky@gmail.com>2016-11-07 17:05:14 +0100
commit0d9dd7c7e366be71ca795b89b48def8b0d201a05 (patch)
tree226f41da3259288722cb6bc0a429ffb084690416 /src/dotty/tools/dotc/typer/Namer.scala
parent913f76a482efc733c01dd262a72de78e795d4b7b (diff)
downloaddotty-0d9dd7c7e366be71ca795b89b48def8b0d201a05.tar.gz
dotty-0d9dd7c7e366be71ca795b89b48def8b0d201a05.tar.bz2
dotty-0d9dd7c7e366be71ca795b89b48def8b0d201a05.zip
Use inline flag instead of @inline annotation
Convert `@inline` annotations to `inline` flags, not the other way round as was done before.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Namer.scala17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala
index 9da0e2edc..725979496 100644
--- a/src/dotty/tools/dotc/typer/Namer.scala
+++ b/src/dotty/tools/dotc/typer/Namer.scala
@@ -521,6 +521,7 @@ class Namer { typer: Typer =>
mergeCompanionDefs()
val ctxWithStats = (ctx /: stats) ((ctx, stat) => indexExpanded(stat)(ctx))
createCompanionLinks(ctxWithStats)
+ //stats foreach enterAnnotations
ctxWithStats
}
@@ -568,19 +569,9 @@ class Namer { typer: Typer =>
val cls = typedAheadAnnotation(annotTree)
val ann = Annotation.deferred(cls, implicit ctx => typedAnnotation(annotTree))
denot.addAnnotation(ann)
- if (cls == defn.InlineAnnot) {
- hasInlineAnnot = true
- addInlineInfo(denot, original)
- }
- }
- if (!hasInlineAnnot && denot.is(InlineMethod)) {
- // create a @inline annotation. Currently, the inlining trigger
- // is really the annotation, not the flag. This is done so that
- // we can still compile inline methods from Scala2x. Once we stop
- // being compatible with Scala2 we should revise the logic to
- // be based on the flag. Then creating a separate annotation becomes unnecessary.
- denot.addAnnotation(Annotation(defn.InlineAnnot))
- addInlineInfo(denot, original)
+ if (cls == defn.InlineAnnot && denot.is(Method, butNot = Accessor))
+ denot.setFlag(Inline)
+ if (denot.isInlineMethod) addInlineInfo(denot, original)
}
case _ =>
}