Skip to content

Commit f5c01c1

Browse files
committed
discard Imports first in typedStats
1 parent f37acc8 commit f5c01c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/transform/Erasure.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,8 @@ object Erasure {
10351035
typed(tree.arg, pt)
10361036

10371037
override def typedStats(stats: List[untpd.Tree], exprOwner: Symbol)(using Context): (List[Tree], Context) = {
1038-
val stats0 = addRetainedInlineBodies(stats)(using preErasureCtx)
1038+
// discard Imports first, since Bridges will use tree's symbol
1039+
val stats0 = addRetainedInlineBodies(stats.filter(!_.isInstanceOf[untpd.Import]))(using preErasureCtx)
10391040
val stats1 =
10401041
if (takesBridges(ctx.owner)) new Bridges(ctx.owner.asClass, erasurePhase).add(stats0)
10411042
else stats0

0 commit comments

Comments
 (0)