| 1 |
From Ltac2 Require Import Ltac2. |
| 2 |
From Ltac2 Require Import Message. |
| 3 |
|
| 4 |
Ltac2 msg s := print (of_string s). |
| 5 |
|
| 6 |
Goal True. |
| 7 |
(* should be the exact error *) |
| 8 |
Fail multi_match! 'True with |
| 9 |
| True => msg "1" |
| 10 |
| _ => msg "2" |
| 11 |
end; |
| 12 |
msg "3"; exact 0. |
| 13 |
|
| 14 |
Fail ltac1:(multimatch True with |
| 15 |
| True => idtac "1" |
| 16 |
| _ => idtac "2" |
| 17 |
end; idtac "3"; exact 0). |
| 18 |
|
| 19 |
Fail multi_match! goal with |
| 20 |
| [ |- True ] => msg "1" |
| 21 |
| [ |- _ ] => msg "2" |
| 22 |
end; |
| 23 |
msg "3"; exact 0. |
| 24 |
|
| 25 |
Fail ltac1:(multimatch goal with |
| 26 |
| |- True => idtac "1" |
| 27 |
| |- _ => idtac "2" |
| 28 |
end; idtac "3"; exact 0). |
| 29 |
|
| 30 |
(* should be match error *) |
| 31 |
Fail multi_match! 'True with |
| 32 |
| True => msg "1" |
| 33 |
| False => msg "2" |
| 34 |
end; |
| 35 |
msg "3"; exact 0. |
| 36 |
|
| 37 |
Fail ltac1:(multimatch True with |
| 38 |
| True => idtac "1" |
| 39 |
| False => idtac "2" |
| 40 |
end; idtac "3"; exact 0). |
| 41 |
|
| 42 |
Fail multi_match! goal with |
| 43 |
| [ |- True ] => msg "1" |
| 44 |
| [ |- False ] => msg "2" |
| 45 |
end; |
| 46 |
msg "3"; exact 0. |
| 47 |
|
| 48 |
Fail ltac1:(multimatch goal with |
| 49 |
| |- True => idtac "1" |
| 50 |
| |- False => idtac "2" |
| 51 |
end; idtac "3"; exact 0). |
| 52 |
|
| 53 |
Abort. |