@@ -4,7 +4,9 @@ package transform
44import dotty .tools .dotc .ast .{Trees , tpd , untpd }
55import scala .collection .mutable
66import core ._
7- import typer .{Checking , VarianceChecker }
7+ import dotty .tools .dotc .typer .Checking
8+ import dotty .tools .dotc .typer .Inliner
9+ import dotty .tools .dotc .typer .VarianceChecker
810import Types ._ , Contexts ._ , Names ._ , Flags ._ , DenotTransformers ._ , Phases ._
911import SymDenotations ._ , StdNames ._ , Annotations ._ , Trees ._ , Scopes ._
1012import Decorators ._
@@ -237,17 +239,7 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
237239 super .transform(tree1)
238240 }
239241 case Inlined (call, bindings, expansion) if ! call.isEmpty =>
240- // Leave only a call trace consisting of
241- // - a reference to the top-level class from which the call was inlined,
242- // - the call's position
243- // in the call field of an Inlined node.
244- // The trace has enough info to completely reconstruct positions.
245- // The minimization is done for two reasons:
246- // 1. To save space (calls might contain large inline arguments, which would otherwise
247- // be duplicated
248- // 2. To enable correct pickling (calls can share symbols with the inlined code, which
249- // would trigger an assertion when pickling).
250- val callTrace = Ident (call.symbol.topLevelClass.typeRef).withPos(call.pos)
242+ val callTrace = Inliner .inlineCallTrace(call.symbol, call.pos)
251243 cpy.Inlined (tree)(callTrace, transformSub(bindings), transform(expansion)(inlineContext(call)))
252244 case tree : Template =>
253245 withNoCheckNews(tree.parents.flatMap(newPart)) {
0 commit comments