| 1 |
Require Import Ltac2.Ltac2. |
| 2 |
|
| 3 |
Ltac2 get_opt o := match o with None => Control.throw Not_found | Some x => x end. |
| 4 |
|
| 5 |
Goal True. |
| 6 |
Proof. |
| 7 |
(* Fails at runtime because not fully applied *) |
| 8 |
Fail ltac1:(ltac2:(x |- ())). |
| 9 |
(* Type mismatch: Ltac1.t vs. constr *) |
| 10 |
Fail ltac1:(ltac2:(x |- pose $x)). |
| 11 |
(* Check that runtime cast is OK *) |
| 12 |
ltac1:(let t := ltac2:(x |- let c := (get_opt (Ltac1.to_constr x)) in pose $c) in t nat). |
| 13 |
(* Type mismatch *) |
| 14 |
Fail ltac1:(let t := ltac2:(x |- let c := (get_opt (Ltac1.to_constr x)) in pose $c) in t ident:(foo)). |
| 15 |
Abort. |