diff options
| author | coqbot-app[bot] | 2021-04-08 12:27:44 +0000 |
|---|---|---|
| committer | GitHub | 2021-04-08 12:27:44 +0000 |
| commit | b7e2dfcc1918e028fb8a4fe353f929f104f13b77 (patch) | |
| tree | 0d11c44e1df6576901e466f1212d1f2ff2e4bdcd /user-contrib | |
| parent | 2b8d8b996b7ae9b5c170792cbf45c4fd96ed3658 (diff) | |
| parent | adc223385c7aa8b43761f4ebb102b4b7b1241123 (diff) | |
Merge PR #14027: Print type of offending expression in Ltac2 not-unit warning.
Reviewed-by: JasonGross
Diffstat (limited to 'user-contrib')
| -rw-r--r-- | user-contrib/Ltac2/tac2intern.ml | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/user-contrib/Ltac2/tac2intern.ml b/user-contrib/Ltac2/tac2intern.ml index 90c8528203..206f4df19d 100644 --- a/user-contrib/Ltac2/tac2intern.ml +++ b/user-contrib/Ltac2/tac2intern.ml @@ -467,7 +467,9 @@ let polymorphic ((n, t) : type_scheme) : mix_type_scheme = let warn_not_unit = CWarnings.create ~name:"not-unit" ~category:"ltac" - (fun () -> strbrk "The following expression should have type unit.") + (fun (env, t) -> + strbrk "The following expression should have type unit but has type " ++ + pr_glbtype env t ++ str ".") let warn_redundant_clause = CWarnings.create ~name:"redundant-clause" ~category:"ltac" @@ -480,7 +482,7 @@ let check_elt_unit loc env t = | GTypRef (Tuple 0, []) -> true | GTypRef _ -> false in - if not maybe_unit then warn_not_unit ?loc () + if not maybe_unit then warn_not_unit ?loc (env, t) let check_elt_empty loc env t = match kind env t with | GTypVar _ -> @@ -504,7 +506,7 @@ let check_unit ?loc t = | GTypRef (Tuple 0, []) -> true | GTypRef _ -> false in - if not maybe_unit then warn_not_unit ?loc () + if not maybe_unit then warn_not_unit ?loc (env, t) let check_redundant_clause = function | [] -> () |
