File tree 2 files changed +5
-12
lines changed 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import dotty.tools.dotc.transform.sjs.JSSymUtils._
36
36
37
37
import JSEncoding ._
38
38
import ScopedVar .withScopedVars
39
+ import dotty .tools .dotc .inlines .Inlines
39
40
40
41
/** Main codegen for Scala.js IR.
41
42
*
@@ -1930,8 +1931,8 @@ class JSCodeGen()(using genCtx: Context) {
1930
1931
case EmptyTree =>
1931
1932
js.Skip ()
1932
1933
1933
- case Inlined (call, bindings, expansion ) =>
1934
- genStatOrExpr(Block (bindings, expansion ), isStat)
1934
+ case inlined @ Inlined (_, _, _ ) =>
1935
+ genStatOrExpr(Inlines .dropInlined(inlined ), isStat)
1935
1936
1936
1937
case _ =>
1937
1938
throw new FatalError (" Unexpected tree in genExpr: " +
Original file line number Diff line number Diff line change @@ -251,19 +251,11 @@ object Inlines:
251
251
252
252
/** Replace `Inlined` node by a block that contains its bindings and expansion */
253
253
def dropInlined (inlined : Inlined )(using Context ): Tree =
254
- val topLevelClass = Option .when(! inlined.call.isEmpty)(inlined.call.symbol.topLevelClass)
255
- val position = (inlined.sourcePos, topLevelClass)
256
- val withPos =
257
- if inlined.expansion.hasAttachment(InliningPosition ) then
258
- val att = InliningPosition (position :: inlined.expansion.getAttachment(InliningPosition ).get.targetPos)
259
- inlined.expansion.withAttachment(InliningPosition , att)
260
- else
261
- inlined.expansion.withAttachment(InliningPosition , InliningPosition (List (position)))
262
254
263
255
if inlined.bindings.isEmpty then
264
- withPos
256
+ inlined.expansion
265
257
else
266
- cpy.Block (inlined)(inlined.bindings, withPos )
258
+ cpy.Block (inlined)(inlined.bindings, inlined.expansion )
267
259
268
260
269
261
You can’t perform that action at this time.
0 commit comments