@@ -75,14 +75,15 @@ object Inliner {
7575 * inlined call `call` to the position of `call`. This transform is necessary
7676 * when lifting bindings from the expansion to the outside of the call.
7777 */
78- def liftFromInlined (call : Tree ) = new TreeMap {
78+ def liftFromInlined (call : Tree ) = new TreeMap :
7979 override def transform (t : Tree )(using Context ) =
80- t match {
81- case Inlined (t, Nil , expr) if t.isEmpty => expr
82- case _ if t.isEmpty => t
83- case _ => super .transform(t.withSpan(call.span))
84- }
85- }
80+ if call.span.exists then
81+ t match
82+ case Inlined (t, Nil , expr) if t.isEmpty => expr
83+ case _ if t.isEmpty => t
84+ case _ => super .transform(t.withSpan(call.span))
85+ else t
86+ end liftFromInlined
8687
8788 val bindings = new mutable.ListBuffer [Tree ]
8889
@@ -108,6 +109,7 @@ object Inliner {
108109 tree
109110 }
110111
112+ // assertAllPositioned(tree) // debug
111113 val tree1 = liftBindings(tree, identity)
112114 if (bindings.nonEmpty)
113115 cpy.Block (tree)(bindings.toList, inlineCall(tree1))
@@ -590,6 +592,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
590592 * itself, it has to be marked as an inlined argument.
591593 */
592594 def integrate (tree : Tree , originalOwner : Symbol )(using Context ): Tree =
595+ // assertAllPositioned(tree) // debug
593596 tree.changeOwner(originalOwner, ctx.owner)
594597
595598 def tryConstValue : Tree =
0 commit comments