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