Skip to content

Commit 9b42eca

Browse files
committed
Fix Inlined abbreviation in erased code
Erased code does not keep full Inlined trees. The previous version converted the Inlined tree back to the call, but this can expose leaks (since calls are not traversed for references). We now keep the Inlined node, so that its call part can be subsequently simplified.
1 parent d0b063a commit 9b42eca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
178178

179179
private object dropInlines extends TreeMap {
180180
override def transform(tree: Tree)(implicit ctx: Context): Tree = tree match {
181-
case Inlined(call, _, _) => Typed(call, TypeTree(tree.tpe))
181+
case Inlined(call, _, _) =>
182+
cpy.Inlined(tree)(call, Nil, Typed(ref(defn.Predef_undefined), TypeTree(tree.tpe)))
182183
case _ => super.transform(tree)
183184
}
184185
}

0 commit comments

Comments
 (0)