From 2dca6c1a3560522a11dd0afda8bd3c61d646ed2e Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Thu, 10 Oct 2019 16:50:16 +0200 Subject: Allow to pass Ltac1 values to Ltac2 quotations. This is the dual of #10344. --- test-suite/ltac2/ltac2env.v | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test-suite/ltac2/ltac2env.v (limited to 'test-suite') 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. -- cgit v1.2.3