diff options
| author | Emilio Jesus Gallego Arias | 2019-03-12 12:57:33 +0100 |
|---|---|---|
| committer | Emilio Jesus Gallego Arias | 2019-03-12 12:57:33 +0100 |
| commit | a5fc75ae3eac4bb2162c624f9d25b53dba022f01 (patch) | |
| tree | 8ea06aea8de163f3a3570500f7123aa20b27d38b /vernac/comInductive.ml | |
| parent | 10c115915ec93b212b75f2fb3073624e6b554840 (diff) | |
| parent | 31f333031b66f7afdfc35662aca9f9f40bbccbd0 (diff) | |
Merge PR #9596: Fix #9595: missing non-primitive-record warning with 0 field record
Reviewed-by: ejgallego
Diffstat (limited to 'vernac/comInductive.ml')
| -rw-r--r-- | vernac/comInductive.ml | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/vernac/comInductive.ml b/vernac/comInductive.ml index 9bbfb8eec6..7fa99b25cb 100644 --- a/vernac/comInductive.ml +++ b/vernac/comInductive.ml @@ -529,7 +529,7 @@ let warn_non_primitive_record = (hov 0 (str "The record " ++ Nametab.pr_global_env Id.Set.empty (IndRef indsp) ++ strbrk" could not be defined as a primitive record"))) -let declare_mutual_inductive_with_eliminations mie pl impls = +let declare_mutual_inductive_with_eliminations ?(primitive_expected=false) mie pl impls = (* spiwack: raises an error if the structure is supposed to be non-recursive, but isn't *) begin match mie.mind_entry_finite with @@ -543,8 +543,7 @@ let declare_mutual_inductive_with_eliminations mie pl impls = let names = List.map (fun e -> e.mind_entry_typename) mie.mind_entry_inds in let (_, kn), prim = declare_mind mie in let mind = Global.mind_of_delta_kn kn in - if match mie.mind_entry_record with Some (Some _) -> not prim | _ -> false - then warn_non_primitive_record (mind,0); + if primitive_expected && not prim then warn_non_primitive_record (mind,0); Declare.declare_univ_binders (IndRef (mind,0)) pl; List.iteri (fun i (indimpls, constrimpls) -> let ind = (mind,i) in |
