Skip to content

Commit 2ed386b

Browse files
bug fix for maps:fold
Summary: - bug fix: checking that the lambda arity is 3 Reviewed By: TD5 Differential Revision: D76293253 fbshipit-source-id: df7fde8174b5e125ea848f69a2c7d471c082cfa2
1 parent 6709faf commit 2ed386b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

eqwalizer/src/main/scala/com/whatsapp/eqwalizer/tc/ElabApplyCustom.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,10 @@ class ElabApplyCustom(pipelineContext: PipelineContext) {
309309
def isShapeIterator(lambda: Lambda): Boolean = {
310310
val lastClauseIndex = lambda.clauses.length - 1
311311
lambda.clauses.zipWithIndex forall { (clause, index) =>
312-
clause.pats.head match {
313-
case PatVar(_) if index == lastClauseIndex =>
312+
clause.pats match {
313+
case List(PatVar(_), _, _) if index == lastClauseIndex =>
314314
true
315-
case PatAtom(_) =>
315+
case List(PatAtom(_), _, _) =>
316316
true
317317
case _ =>
318318
false

0 commit comments

Comments
 (0)