diff options
author | Martin Odersky <odersky@gmail.com> | 2016-09-06 13:20:39 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-10-02 16:11:21 +0200 |
commit | 19ab7ab10fabe7113f45063ffd2b6cc6abcc3329 (patch) | |
tree | 3672315832460f5d636074fc2c387d243597cff5 /src/dotty/tools/dotc/typer/Typer.scala | |
parent | bd0660ef100ee1a41bd56267d9e95c9e6dd74d5e (diff) | |
download | dotty-19ab7ab10fabe7113f45063ffd2b6cc6abcc3329.tar.gz dotty-19ab7ab10fabe7113f45063ffd2b6cc6abcc3329.tar.bz2 dotty-19ab7ab10fabe7113f45063ffd2b6cc6abcc3329.zip |
Make inline annotation @scala.inline.
Drop @dotty.annotation.inline. This will inline all
@inline marked methods in Scala for which a body is known
(i.e. that are either compiled in the same run or have Tasty
trees available).
Option -Yno-inline suppresses inlining. This is needed for
the moment because some @inline methods access private members
or members that are otherwise inaccessible at the call-site.
Also fixes some problems in Inliner
- make sure type arguments to inline calls re fully defined
- don't forget recursive calls in typeMap
- don't forget positions in treeMap
- drop dead code dealing with outer.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 22a5095ec..29c36805f 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -1794,7 +1794,9 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit } else if (tree.tpe <:< pt) if (tree.symbol.isInlineMethod && + Inliner.inlinedBody(tree.symbol).isDefined && !ctx.owner.ownersIterator.exists(_.isInlineMethod) && + !ctx.settings.YnoInline.value && !ctx.isAfterTyper) adapt(Inliner.inlineCall(tree, pt), pt) else if (ctx.typeComparer.GADTused && pt.isValueType) |