| 1 |
Require Import Ltac2.Ltac2. |
| 2 |
|
| 3 |
#[projections(primitive)] |
| 4 |
Record r (n : nat) := { w : Prop -> Prop -> Prop }. |
| 5 |
|
| 6 |
Class C (P : Prop) := {}. |
| 7 |
|
| 8 |
Import Printf. |
| 9 |
Set Printing Primitive Projection Parameters. |
| 10 |
|
| 11 |
Goal forall (v : r 0) (Q P : Prop), C (v.(w _) P Q). |
| 12 |
Proof. |
| 13 |
intros. |
| 14 |
|
| 15 |
(* Succeeds before and after #17788. *) |
| 16 |
Succeed lazy_match! goal with |
| 17 |
| [ |- ?g ] => |
| 18 |
let t := open_constr:(C (v.(w _) _ _)) in |
| 19 |
Unification.unify (TransparentState.current ()) g t |
| 20 |
end. |
| 21 |
|
| 22 |
#[local] Opaque w. |
| 23 |
|
| 24 |
(* Succeeds only after #17788. *) |
| 25 |
Succeed lazy_match! goal with |
| 26 |
| [ |- ?g ] => |
| 27 |
let t := open_constr:(C (v.(w _) _ _)) in |
| 28 |
Unification.unify (TransparentState.current ()) g t |
| 29 |
end. |
| 30 |
|
| 31 |
(* Succeeds only after #17788. *) |
| 32 |
Succeed lazy_match! goal with |
| 33 |
| [ |- ?g ] => |
| 34 |
let t := open_constr:(w _) in |
| 35 |
let t := open_constr:(C ($t v _ _)) in |
| 36 |
(*printf "Term: %t" t;*) |
| 37 |
Unification.unify (TransparentState.current ()) g t |
| 38 |
end. |
| 39 |
|
| 40 |
(* Succeeds only after #17788. *) |
| 41 |
Succeed lazy_match! goal with |
| 42 |
| [ |- ?g ] => |
| 43 |
let t := open_constr:(w _) in |
| 44 |
let t := open_constr:(C ($t v _ _)) in |
| 45 |
(*printf "Term: %t" t;*) |
| 46 |
Unification.unify (TransparentState.current ()) g t |
| 47 |
end. |
| 48 |
Abort. |