diff options
| author | Gaëtan Gilbert | 2020-01-29 16:36:02 +0100 |
|---|---|---|
| committer | Gaëtan Gilbert | 2020-01-29 16:52:19 +0100 |
| commit | f86fd4b52a29e2ef63f03cc67c845f1fa05aae13 (patch) | |
| tree | 8eed7cda2bb37ac825474e19c1048d1d68d24b5a /vernac/himsg.ml | |
| parent | 8c04d108e1f57d0e8e11483a7c9de721ab2f026a (diff) | |
Nicer kernel universe error for inductives
Not sure if it's possible to see it without a plugin.
Diffstat (limited to 'vernac/himsg.ml')
| -rw-r--r-- | vernac/himsg.ml | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/vernac/himsg.ml b/vernac/himsg.ml index eb39564fed..17c3e0395a 100644 --- a/vernac/himsg.ml +++ b/vernac/himsg.ml @@ -1216,8 +1216,12 @@ let error_bad_entry () = let error_large_non_prop_inductive_not_in_type () = str "Large non-propositional inductive types must be in Type." -let error_inductive_bad_univs () = - str "Incorrect universe constraints declared for inductive type." +let error_inductive_missing_constraints (us,ind_univ) = + let pr_u = Univ.Universe.pr_with UnivNames.pr_with_global_universes in + str "Missing universe constraint declared for inductive type:" ++ spc() + ++ v 0 (prlist_with_sep spc (fun u -> + hov 0 (pr_u u ++ str " <= " ++ pr_u ind_univ)) + (Univ.Universe.Set.elements us)) (* Recursion schemes errors *) @@ -1256,7 +1260,7 @@ let explain_inductive_error = function | BadEntry -> error_bad_entry () | LargeNonPropInductiveNotInType -> error_large_non_prop_inductive_not_in_type () - | BadUnivs -> error_inductive_bad_univs () + | MissingConstraints csts -> error_inductive_missing_constraints csts (* Recursion schemes errors *) |
