Skip to content

Commit 845fd59

Browse files
authored
Merge pull request #5692 from dotty-staging/conserve-more-lists
Conserve a more lists to allow a few cpy.Apply to not create a new instance
2 parents c4ecf04 + 2ff968f commit 845fd59

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
210210
if (methType.isErasedMethod)
211211
tpd.cpy.Apply(tree)(
212212
tree.fun,
213-
tree.args.map(arg =>
213+
tree.args.mapConserve(arg =>
214214
if (methType.isImplicitMethod && arg.pos.isSynthetic) ref(defn.Predef_undefined)
215215
else dropInlines.transform(arg)))
216216
else

compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ abstract class Lifter {
8585
lifter.liftArg(defs, arg, if (name.firstPart contains '$') EmptyTermName else name)
8686
}
8787
case _ =>
88-
args.map(liftArg(defs, _))
88+
args.mapConserve(liftArg(defs, _))
8989
}
9090

9191
/** Lift out function prefix and all arguments from application

0 commit comments

Comments
 (0)