diff options
author | Martin Odersky <odersky@gmail.com> | 2016-09-04 18:18:57 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-10-02 16:11:21 +0200 |
commit | a81070ca1af106688b03c46d96f4266934d8cfbb (patch) | |
tree | ec4520668276b45cf083e73f2a043a224325ce71 /src/dotty/tools/dotc/typer/Typer.scala | |
parent | c1674dc461ee3f4bf38b7b895cfc9d7d6b41b53f (diff) | |
download | dotty-a81070ca1af106688b03c46d96f4266934d8cfbb.tar.gz dotty-a81070ca1af106688b03c46d96f4266934d8cfbb.tar.bz2 dotty-a81070ca1af106688b03c46d96f4266934d8cfbb.zip |
Fix some problems in Inliner
1. Don't retypecheck the arguments of an inlined epressions.
These might be very large (e.g. inlined track, or traceIndented in dotty)/
2. Keep track of inlined calls in context instead of
Inlined nodes. We only need the to compute the source file, the rest
is irrelevant.
3. In Def bindings of inlined by-name parameters, change owner of right
hand side. Otherwise we get incorrect owner chains.
4. In TreeTypeMap, treat Inlined in the same way as a block.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index e809605f4..09259b361 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -947,7 +947,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit def typedInlined(tree: untpd.Inlined, pt: Type)(implicit ctx: Context): Inlined = { val (exprCtx, bindings1) = typedBlockStats(tree.bindings) - val expansion1 = typed(tree.expansion, pt)(Inliner.inlineContext(tree)(exprCtx)) + val expansion1 = typed(tree.expansion, pt)(Inliner.inlineContext(tree.call)(exprCtx)) cpy.Inlined(tree)(tree.call, bindings1.asInstanceOf[List[MemberDef]], expansion1) .withType(expansion1.tpe) } |