Before this commit, each `isDefEq u v` invocation would fail if there were pending universe level constraints. This commit, moves the postponed universe constraints back to the `MetaM` state. It also adds the combinator ```lean withoutPostponingUniverseConstraints x ``` which executes `x` and throws an error if there are pending universe constraints. We use the combinator at `elabApp` and `elabBinders`. Without this commit, we would fail to elaborate simple terms such as ```lean Functor.map Prod.fst (x s) ``` because after elaborating `Prod.fst` and trying to ensure its type match the expected one, we would be stuck at the universe constraint: ``` u =?= max u ?v ``` Another benefit of the new approach is better error messages. Instead of getting a mysterious type mismatch constraint, we get a list of universe contraints the system is stuck at. cc @Kha
7 lines
308 B
Text
7 lines
308 B
Text
universes u v
|
||
|
||
@[inline] def ex1 {σ : Type u} {m : Type u → Type v} [Functor m] {α : Type u} (x : StateT σ m α) (s : σ) : m α :=
|
||
Functor.map Prod.fst (x s)
|
||
|
||
@[inline] def ex2 {σ : Type u} {m : Type u → Type v} [Functor m] {α : Type u} (x : StateT σ m α) (s : σ) : m α :=
|
||
Prod.fst <$> x s
|