diff options
| author | Gaëtan Gilbert | 2019-10-28 14:40:41 +0100 |
|---|---|---|
| committer | Gaëtan Gilbert | 2019-10-28 14:42:26 +0100 |
| commit | ed6c6e8c39099d39faa3f036ca7f3e0c6359a4aa (patch) | |
| tree | 4a1f7e473cd326235c31dcbb7197edfa74e8d1bc /kernel | |
| parent | b5d1c31e2d10084935d36a67e0d44b725210b979 (diff) | |
Fix #10903: type-in-type allows fixpoints on sprop inductives
I still don't know why it produces a Not_found instead of a regular
error in coqtop but let's forget about it.
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/inductive.ml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/inductive.ml b/kernel/inductive.ml index cd969ea457..a5a8c8d38c 100644 --- a/kernel/inductive.ml +++ b/kernel/inductive.ml @@ -1119,9 +1119,10 @@ let inductive_of_mutfix env ((nvect,bodynum),(names,types,bodies as recdef)) = | _ -> raise_err env i NotEnoughAbstractionInFixBody in let ((ind, _), _) as res = check_occur fixenv 1 def in - let _, ind = lookup_mind_specif env ind in + let _, mip = lookup_mind_specif env ind in (* recursive sprop means non record with projections -> squashed *) - if Sorts.Irrelevant == ind.mind_relevance + if mip.mind_relevance == Sorts.Irrelevant && + not (Environ.is_type_in_type env (GlobRef.IndRef ind)) then begin if names.(i).Context.binder_relevance == Sorts.Relevant |
