Skip to content

Commit 42cbf5c

Browse files
committed
Don't eta expand in Pattern mode.
1 parent 97d6205 commit 42cbf5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2016,7 +2016,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
20162016
else -1 // no eta expansion in this case
20172017
}
20182018

2019-
if (arity >= 0 && !tree.symbol.isConstructor)
2019+
if (arity >= 0 && !tree.symbol.isConstructor && !ctx.mode.is(Mode.Pattern))
20202020
typed(etaExpand(tree, wtp, arity), pt)
20212021
else if (wtp.paramInfos.isEmpty)
20222022
adaptInterpolated(tpd.Apply(tree, Nil), pt, EmptyTree)

0 commit comments

Comments
 (0)