Skip to content
Snippets Groups Projects
Commit 1f36e734 authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

Better error message when the argument of iSpecialize is not a hypothesis.

parent 4b2f81cc
No related branches found
No related tags found
No related merge requests found
...@@ -338,15 +338,19 @@ Tactic Notation "iSpecializeCore" open_constr(t) "as" constr(p) tactic(tac) := ...@@ -338,15 +338,19 @@ Tactic Notation "iSpecializeCore" open_constr(t) "as" constr(p) tactic(tac) :=
end in end in
lazymatch t with lazymatch t with
| ITrm ?H ?xs ?pat => | ITrm ?H ?xs ?pat =>
lazymatch p with lazymatch type of H with
| true => | string =>
eapply tac_specialize_persistent_helper with _ H _ _ _; lazymatch p with
[env_cbv; reflexivity || fail "iSpecialize:" H "not found" | true =>
|iSpecializeArgs H xs; iSpecializePat H pat; last (iExact H) eapply tac_specialize_persistent_helper with _ H _ _ _;
|let Q := match goal with |- PersistentP ?Q => Q end in [env_cbv; reflexivity || fail "iSpecialize:" H "not found"
apply _ || fail "iSpecialize:" Q "not persistent" |iSpecializeArgs H xs; iSpecializePat H pat; last (iExact H)
|env_cbv; reflexivity|tac H] |let Q := match goal with |- PersistentP ?Q => Q end in
| false => iSpecializeArgs H xs; iSpecializePat H pat; last (tac H) apply _ || fail "iSpecialize:" Q "not persistent"
|env_cbv; reflexivity|tac H]
| false => iSpecializeArgs H xs; iSpecializePat H pat; last (tac H)
end
| _ => fail "iSpecialize:" H "should be a hypothesis, use iPoseProof instead"
end end
end. end.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment