diff options
| author | Matthieu Sozeau | 2014-06-23 18:29:07 +0200 |
|---|---|---|
| committer | Matthieu Sozeau | 2014-06-23 18:31:17 +0200 |
| commit | 1f11c1f1366b4c82e2e596b3cc97ee0052189741 (patch) | |
| tree | da1ad0cc24aea020f386d729b8dc8e0442537931 /pretyping | |
| parent | ee2adce57aac1ffe21681a9d31a8e8bc4f94210b (diff) | |
Fix for bug 1951, allowing at least fully-applied inductives types to be used
for building polymorphic instances of template polymorphic inductives.
Diffstat (limited to 'pretyping')
| -rw-r--r-- | pretyping/pretyping.ml | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pretyping/pretyping.ml b/pretyping/pretyping.ml index 2c16c2eb35..27abdbade8 100644 --- a/pretyping/pretyping.ml +++ b/pretyping/pretyping.ml @@ -590,10 +590,13 @@ let rec pretype resolve_tc (tycon : type_constraint) env evdref lvar t = match evar_kind_of_term !evdref resj.uj_val with | App (f,args) -> let f = whd_evar !evdref f in - if is_template_polymorphic env f then + if isInd f && is_template_polymorphic env f then + (* Special case for inductive type applications that must be + refreshed right away. *) let sigma = !evdref in let c = mkApp (f,Array.map (whd_evar sigma) args) in - let t = Retyping.get_type_of env sigma c in + let c = evd_comb1 (Evarsolve.refresh_universes true env) evdref c in + let t = Retyping.get_type_of env !evdref c in make_judge c (* use this for keeping evars: resj.uj_val *) t else resj | _ -> resj |
