Skip to content

Commit 1ee7934

Browse files
committed
Don't eta expand in Pattern mode.
1 parent fb5ed85 commit 1ee7934

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
@@ -2012,7 +2012,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
20122012
else -1 // no eta expansion in this case
20132013
}
20142014

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

0 commit comments

Comments
 (0)