| 1 |
(* coq-prog-args: ("-top" "Errors") *) |
| 2 |
(* Test error messages *) |
| 3 |
|
| 4 |
Set Ltac Backtrace. |
| 5 |
|
| 6 |
(* Test non-regression of bug fixed in r13486 (bad printer for module names) *) |
| 7 |
|
| 8 |
Module Type S. |
| 9 |
Parameter t:Type. |
| 10 |
End S. |
| 11 |
Module M : S. |
| 12 |
Fail End M. |
| 13 |
|
| 14 |
(* A simple check of how Ltac trace are used or not *) |
| 15 |
(* Unfortunately, cannot test error location... *) |
| 16 |
|
| 17 |
Ltac f x := apply x. |
| 18 |
Goal True. |
| 19 |
Fail simpl; apply 0. |
| 20 |
Fail simpl; f 0. |
| 21 |
Abort. |
| 22 |
|
| 23 |
(* Test instantiate error messages *) |
| 24 |
|
| 25 |
Goal forall T1 (P1 : T1 -> Type), sigT P1 -> sigT P1. |
| 26 |
intros T1 P1 H1. |
| 27 |
eexists ?[x]. |
| 28 |
destruct H1 as [x1 H1]. |
| 29 |
Fail instantiate (x:=projT1 x1). |
| 30 |
Abort. |
| 31 |
|
| 32 |
(* Test some messages for non solvable evars *) |
| 33 |
|
| 34 |
Fail Goal forall a f, f a = 0. |
| 35 |
Fail Goal forall f x, id f x = 0. |
| 36 |
Fail Goal forall f P, P (f 0). |
| 37 |
|
| 38 |
Definition t := unit. |
| 39 |
End M. |
| 40 |
|
| 41 |
Module Change. |
| 42 |
|
| 43 |
Goal 0 = 0. |
| 44 |
Fail change 0 with true. |
| 45 |
Abort. |
| 46 |
|
| 47 |
Goal nat = nat. |
| 48 |
pose (nat : Type) as n. |
| 49 |
Fail change nat with n. (* Error: Replacement would lead to an ill-typed term. *) |
| 50 |
Abort. |
| 51 |
|
| 52 |
End Change. |