aboutsummaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
authorJason Gross2019-10-22 15:36:25 -0400
committerJason Gross2019-10-22 15:36:25 -0400
commit694d70d92cac55147f88840957b15a147d038db9 (patch)
tree52d2a05af0e09b1975cd82b4db216c9322fd5f29 /test-suite
parentac8633ba19a7d8e937bbd6f9b7de2ad82b89f22f (diff)
parent2dca6c1a3560522a11dd0afda8bd3c61d646ed2e (diff)
Merge PR #10880: Allow to pass Ltac1 values to Ltac2 quotations.
Ack-by: SkySkimmer Reviewed-by: Zimmi48
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/ltac2/ltac2env.v15
1 files changed, 15 insertions, 0 deletions
diff --git a/test-suite/ltac2/ltac2env.v b/test-suite/ltac2/ltac2env.v
new file mode 100644
index 0000000000..743e62932d
--- /dev/null
+++ b/test-suite/ltac2/ltac2env.v
@@ -0,0 +1,15 @@
+Require Import Ltac2.Ltac2.
+
+Ltac2 get_opt o := match o with None => Control.throw Not_found | Some x => x end.
+
+Goal True.
+Proof.
+(* Fails at runtime because not fully applied *)
+Fail ltac1:(ltac2:(x |- ())).
+(* Type mismatch: Ltac1.t vs. constr *)
+Fail ltac1:(ltac2:(x |- pose $x)).
+(* Check that runtime cast is OK *)
+ltac1:(let t := ltac2:(x |- let c := (get_opt (Ltac1.to_constr x)) in pose $c) in t nat).
+(* Type mismatch *)
+Fail ltac1:(let t := ltac2:(x |- let c := (get_opt (Ltac1.to_constr x)) in pose $c) in t ident:(foo)).
+Abort.