fix: infinite loop in isClassApp?
This commit is contained in:
parent
5661b15e35
commit
9ec9ea61a4
1 changed files with 4 additions and 2 deletions
|
|
@ -986,7 +986,7 @@ mutual
|
|||
|
||||
|
||||
-- Helper method for isClassExpensive?
|
||||
private partial def isClassApp? (type : Expr) : MetaM (Option Name) := do
|
||||
private partial def isClassApp? (type : Expr) (instantiated := false) : MetaM (Option Name) := do
|
||||
match type.getAppFn with
|
||||
| .const c _ =>
|
||||
let env ← getEnv
|
||||
|
|
@ -997,7 +997,9 @@ mutual
|
|||
match (← whnf type).getAppFn with
|
||||
| .const c _ => if isClass env c then return some c else return none
|
||||
| _ => return none
|
||||
| .mvar .. => isClassApp? (← instantiateMVars type)
|
||||
| .mvar .. =>
|
||||
if instantiated then return none
|
||||
isClassApp? (← instantiateMVars type) true
|
||||
| _ => return none
|
||||
|
||||
private partial def isClassExpensive? (type : Expr) : MetaM (Option Name) :=
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue