diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-03-20 12:54:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-20 12:54:27 +0100 |
commit | 641e0de187294b808aeb39db080282ed03a48321 (patch) | |
tree | 153a1078c9cb44ed4de7e46d0b711d87afc0a01f /compiler | |
parent | 53b808f27229cd2eefaf5b4141b3519cdc886b79 (diff) | |
parent | 8497a6ab66b2910b1937110b3388831bd159a13c (diff) | |
download | dotty-641e0de187294b808aeb39db080282ed03a48321.tar.gz dotty-641e0de187294b808aeb39db080282ed03a48321.tar.bz2 dotty-641e0de187294b808aeb39db080282ed03a48321.zip |
Merge pull request #2114 from dotty-staging/fix/inline-error-pos
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 { |