fix: isDomainDefEq

This commit is contained in:
Leonardo de Moura 2022-04-13 07:54:47 -07:00
parent 600769811e
commit 2ec8385767

View file

@ -640,8 +640,17 @@ private def isDomainDefEq (arrowType : Expr) (type : Expr) : MetaM Bool := do
if !arrowType.isForall then
return false
else
withNewMCtxDepth do -- Make sure we do not assign univers metavariables
isDefEq arrowType.bindingDomain! type
/-
We used to use `withNewMCtxDepth` to make sure we do not assign universe metavariables,
but it was not satisfactory. For example, in declarations such as
```
inductive Eq : αα → Prop where
| refl (a : α) : Eq a a
```
We want the first two indices to be promoted to parameters, and this will only
happen if we can assign universe metavariables.
-/
isDefEq arrowType.bindingDomain! type
/--
Convert fixed indices to parameters.