Skip to content

Commit 07bf063

Browse files
committed
Merge pull request #1102 from dotty-staging/fix-#1096
Keep named arguments during eta expansion
2 parents dfa3ec8 + cdfbdb1 commit 07bf063

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,11 @@ object EtaExpansion {
4848
}
4949

5050
/** Lift a function argument, stripping any NamedArg wrapper */
51-
def liftArg(defs: mutable.ListBuffer[Tree], arg: Tree, prefix: String = "")(implicit ctx: Context): Tree = {
52-
val arg1 = arg match {
53-
case NamedArg(_, arg1) => arg1
54-
case arg => arg
51+
def liftArg(defs: mutable.ListBuffer[Tree], arg: Tree, prefix: String = "")(implicit ctx: Context): Tree =
52+
arg match {
53+
case arg @ NamedArg(name, arg1) => cpy.NamedArg(arg)(name, lift(defs, arg1, prefix))
54+
case arg => lift(defs, arg, prefix)
5555
}
56-
lift(defs, arg1, prefix)
57-
}
5856

5957
/** Lift arguments that are not-idempotent into ValDefs in buffer `defs`
6058
* and replace by the idents of so created ValDefs.

0 commit comments

Comments
 (0)