fix: try to postpone if function type is not known

This commit is contained in:
Leonardo de Moura 2019-12-19 14:20:56 -08:00
parent 8d81e89e53
commit bfca7e32e0
2 changed files with 3 additions and 0 deletions

View file

@ -111,6 +111,8 @@ private partial def elabAppArgsAux (ref : Syntax) (args : Array Arg) (expectedTy
private def elabAppArgs (ref : Syntax) (f : Expr) (namedArgs : Array NamedArg) (args : Array Arg)
(expectedType? : Option Expr) (explicit : Bool) : TermElabM Expr := do
fType ← inferType ref f;
fType ← instantiateMVars ref fType;
tryPostponeIfMVar fType;
let argIdx := 0;
let instMVars := #[];
elabAppArgsAux ref args expectedType? explicit argIdx namedArgs instMVars fType f

View file

@ -155,3 +155,4 @@ f a
#eval run "#check #[1, 2, 3].foldl (fun r a => (r.push a).push a) #[]"
#eval run "#check #[1, 2, 3].foldl (fun r a => ((r.push a).push a).push a) #[]"
#eval run "#check #[].push one $.push two $.push zero $.size.succ"
#eval run "#check #[1, 2].foldl (fun r a => r.push a $.push a $.push a) #[]"