We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f5a08c8 commit 0cd0778Copy full SHA for 0cd0778
compiler/src/dotty/tools/dotc/transform/Erasure.scala
@@ -1035,7 +1035,8 @@ object Erasure {
1035
typed(tree.arg, pt)
1036
1037
override def typedStats(stats: List[untpd.Tree], exprOwner: Symbol)(using Context): (List[Tree], Context) = {
1038
- val stats0 = addRetainedInlineBodies(stats)(using preErasureCtx)
+ // discard Imports first, since Bridges will use tree's symbol
1039
+ val stats0 = addRetainedInlineBodies(stats.filter(!_.isInstanceOf[untpd.Import]))(using preErasureCtx)
1040
val stats1 =
1041
if (takesBridges(ctx.owner)) new Bridges(ctx.owner.asClass, erasurePhase).add(stats0)
1042
else stats0
0 commit comments