fix: ensure inferForallType at LCNF handles universes like the kernel and MetaM
This commit is contained in:
parent
8c84531330
commit
c0ac2138f7
2 changed files with 9 additions and 2 deletions
|
|
@ -263,10 +263,10 @@ mutual
|
|||
let e := e.instantiateRev fvars
|
||||
let some u ← getLevel? e | return anyTypeExpr
|
||||
let mut u := u
|
||||
for x in fvars do
|
||||
for x in fvars.reverse do
|
||||
let xType ← inferType x
|
||||
let some v ← getLevel? xType | return anyTypeExpr
|
||||
u := .imax v u
|
||||
u := mkLevelIMax' v u
|
||||
return .sort u.normalize
|
||||
|
||||
partial def inferLambdaType (e : Expr) : InferTypeM Expr :=
|
||||
|
|
|
|||
7
tests/lean/run/inferForallTypeLCNF.lean
Normal file
7
tests/lean/run/inferForallTypeLCNF.lean
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import Lean
|
||||
|
||||
variable {U V}
|
||||
|
||||
def f : (U → V) → (U → U) := sorry
|
||||
|
||||
#eval Lean.Compiler.compile #[``f]
|
||||
Loading…
Add table
Reference in a new issue