refactor: use isAppOfArity (#3394)

This commit is contained in:
Joachim Breitner 2024-02-19 10:24:11 +01:00 committed by GitHub
parent 16757bb256
commit da24708ba5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -119,7 +119,7 @@ private partial def generalizeMatchDiscrs (mvarId : MVarId) (matcherDeclName : N
let foundRef ← IO.mkRef false
let rec mkNewTarget (e : Expr) : MetaM Expr := do
let pre (e : Expr) : MetaM TransformStep := do
if !e.isAppOf matcherDeclName || e.getAppNumArgs != matcherInfo.arity then
if !e.isAppOfArity matcherDeclName matcherInfo.arity then
return .continue
let some matcherApp ← matchMatcherApp? e | return .continue
for matcherDiscr in matcherApp.discrs, discr in discrs do