File tree 1 file changed +5
-5
lines changed
compiler/src/dotty/tools/dotc/typer
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -152,8 +152,11 @@ object Inliner {
152
152
153
153
/** Replace `Inlined` node by a block that contains its bindings and expansion */
154
154
def dropInlined (inlined : Inlined )(implicit ctx : Context ): Tree =
155
- if (enclosingInlineds.nonEmpty) inlined // Remove in the outer most inlined call
156
- else reposition(inlined, inlined.call.span)
155
+ val tree1 = // Block or expansion with the correct original span
156
+ if inlined.bindings.isEmpty then inlined.expansion
157
+ else cpy.Block (inlined)(inlined.bindings, inlined.expansion)
158
+ // Reposition in the outer most inlined call
159
+ if (enclosingInlineds.nonEmpty) tree1 else reposition(tree1, inlined.span)
157
160
158
161
def reposition (tree : Tree , callSpan : Span )(implicit ctx : Context ): Tree = {
159
162
val curSource = ctx.compilationUnit.source
@@ -183,9 +186,6 @@ object Inliner {
183
186
given as Context = ctx.withSource(curSource)
184
187
185
188
tree match {
186
- case tree : Inlined =>
187
- if tree.bindings.isEmpty then transform(tree.expansion)
188
- else transform(cpy.Block (tree)(tree.bindings, tree.expansion))
189
189
case tree : Ident => finalize(untpd.Ident (tree.name)(curSource))
190
190
case tree : Literal => finalize(untpd.Literal (tree.const)(curSource))
191
191
case tree : This => finalize(untpd.This (tree.qual)(curSource))
You can’t perform that action at this time.
0 commit comments