without extending ... (since this could cause divergence) should be considered
an uncertain (since extension may be necessary).
aux metasenv subst args_so_far he ty_he
(NCic.Implicit `Term :: NCic.Implicit `Vector :: tl)
with
- Uncertain msg | RefineFailure msg -> raise (wrap_exc msg exc)))
+ Uncertain msg | RefineFailure msg -> raise (wrap_exc msg exc))
+ | RefineFailure msg when not (has_some_more_pis ty_he) ->
+ (* instantiating the head could change the has_some_more_pis flag *)
+ raise (Uncertain msg))
| arg::tl ->
match NCicReduction.whd ~subst context ty_he with
| C.Prod (_,s,t) ->