diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-03-16 22:09:12 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2017-03-16 22:45:34 +0100 |
commit | 8497a6ab66b2910b1937110b3388831bd159a13c (patch) | |
tree | 9aeea808b94896737d704bba21bbf8cb76d59fef /compiler | |
parent | 2325863c216e2bf4f7ad0f366bb80ef866ff6b79 (diff) | |
download | dotty-8497a6ab66b2910b1937110b3388831bd159a13c.tar.gz dotty-8497a6ab66b2910b1937110b3388831bd159a13c.tar.bz2 dotty-8497a6ab66b2910b1937110b3388831bd159a13c.zip |
Fix position of errors in Inliner TreeTypeMap
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/src/dotty/tools/dotc/typer/Inliner.scala | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Inliner.scala b/compiler/src/dotty/tools/dotc/typer/Inliner.scala index 27c7d0c2f..6e90367c8 100644 --- a/compiler/src/dotty/tools/dotc/typer/Inliner.scala +++ b/compiler/src/dotty/tools/dotc/typer/Inliner.scala @@ -457,16 +457,17 @@ class Inliner(call: tpd.Tree, rhs: tpd.Tree)(implicit ctx: Context) { case _ => tree }} - // The complete translation maps referenves to this and parameters to + val inlineCtx = inlineContext(call) + // The complete translation maps references to `this` and parameters to // corresponding arguments or proxies on the type and term level. It also changes // the owner from the inlined method to the current owner. - val inliner = new TreeTypeMap(typeMap, treeMap, meth :: Nil, ctx.owner :: Nil) + val inliner = new TreeTypeMap(typeMap, treeMap, meth :: Nil, ctx.owner :: Nil)(inlineCtx) val expansion = inliner(rhs.withPos(call.pos)) ctx.traceIndented(i"inlining $call\n, BINDINGS =\n${bindingsBuf.toList}%\n%\nEXPANSION =\n$expansion", inlining, show = true) { // The final expansion runs a typing pass over the inlined tree. See InlineTyper for details. - val expansion1 = InlineTyper.typed(expansion, pt)(inlineContext(call)) + val expansion1 = InlineTyper.typed(expansion, pt)(inlineCtx) /** Does given definition bind a closure that will be inlined? */ def bindsDeadClosure(defn: ValOrDefDef) = Ident(defn.symbol.termRef) match { |