diff options
| author | Pierre-Marie Pédrot | 2019-11-10 19:31:37 +0100 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2019-11-10 19:31:37 +0100 |
| commit | d433d9e61cf030391e33cda70c41b635b286d934 (patch) | |
| tree | e1b537ec0a0ba728ac9de8d547e3cec6bb3247ac /kernel | |
| parent | 69b91851ed5d18f1ca34ef2597f0cf342c10a124 (diff) | |
| parent | ed6c6e8c39099d39faa3f036ca7f3e0c6359a4aa (diff) | |
Merge PR #10980: Fix #10903: type-in-type allows fixpoints on sprop inductives
Reviewed-by: ppedrot
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 fdd09436d4..2966acae45 100644 --- a/kernel/inductive.ml +++ b/kernel/inductive.ml @@ -1124,9 +1124,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 |
