File tree 1 file changed +7
-5
lines changed
compiler/src/dotty/tools/dotc/typer
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -152,10 +152,15 @@ 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 =
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 = {
162
+ // Reference test tests/run/i4947b
163
+
159
164
val curSource = ctx.compilationUnit.source
160
165
161
166
// Tree copier that changes the source of all trees to `curSource`
@@ -183,9 +188,6 @@ object Inliner {
183
188
given as Context = ctx.withSource(curSource)
184
189
185
190
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
191
case tree : Ident => finalize(untpd.Ident (tree.name)(curSource))
190
192
case tree : Literal => finalize(untpd.Literal (tree.const)(curSource))
191
193
case tree : This => finalize(untpd.This (tree.qual)(curSource))
You can’t perform that action at this time.
0 commit comments