Trying to improve the error messages of injection.
Trying to improve the error messages of injection.

Below are a few examples where the previous messages were misleading:

Module InProp.

Inductive tree : Prop := Leaf | Node : tree -> tree -> tree.

Variables x y : tree.

(* Wrong msg: "Nothing to do, it is an equality between convertible terms." *)
(* These terms are not convertible *)
Goal Node Leaf Leaf = Leaf -> False.
Fail intros H; injection H.
Abort.

End InProp.

Module InSet.

Inductive tree : Set := Leaf | Node : tree -> tree -> tree.

Variables x y : tree.

(* Wrong msg: "Not a projectable equality but a discriminable one." *)
(* This equality is both projectable and discriminable *)
Goal Node x (Node Leaf Leaf) = Node Leaf Leaf -> False.
intros H.
Fail injection H.
Abort.

End InSet.

letouzey/coq-wip,jpdeplaix/coq,Matafou/coq,gares/coq,mattam82/coq,SkySkimmer/coq,shindere/coq,mlasson/coq,8l/coq,JasonGross/coq,Ptival/coq,Lionel-Rieg/coq,Zimmi48/coq,mlasson/coq,SkySkimmer/coq,ppedrot/coq,ppedrot/coq,mattam82/coq,Zimmi48/coq,8l/coq,coq/coq,mlasson/coq,maximedenes/coq,mattam82/coq,maximedenes/coq,TheTypoMaster/coq,amintimany/coq,SkySkimmer/coq,william-lawvere/coq,ppedrot/coq,TOSPIO/coq,TheTypoMaster/coq,gares/coq,8l/coq,silene/coq,ale-f/coq,pirapira/coq2rust,gares/coq,barras/coq,TheTypoMaster/coq,asr/coq,maximedenes/coq,barras/coq,coq/coq,aspiwack/coq,Ptival/coq,JasonGross/coq,letouzey/coq-wip,letouzey/coq-wip,gmalecha/coq,pirapira/coq2rust,letouzey/coq-wip,ejgallego/coq,gmalecha/coq,Zimmi48/coq,ppedrot/coq,Matafou/coq,ppedrot/coq,barras/coq,william-lawvere/coq,Lionel-Rieg/coq,shindere/coq,Matafou/coq,ejgallego/coq,JasonGross/coq,gares/coq,maximedenes/coq,Ptival/coq,amintimany/coq,asr/coq,herbelin/github-coq,gmalecha/coq,amintimany/coq,silene/coq,aspiwack/coq,coq/coq,gares/coq,maximedenes/coq,coq/coq,ale-f/coq,aspiwack/coq,asr/coq,jpdeplaix/coq,TOSPIO/coq,Zimmi48/coq,ejgallego/coq,letouzey/coq-wip,silene/coq,TOSPIO/coq,william-lawvere/coq,jpdeplaix/coq,herbelin/github-coq,herbelin/github-coq,Lionel-Rieg/coq,pirapira/coq2rust,JasonGross/coq,ale-f/coq,shindere/coq,ejgallego/coq,SkySkimmer/coq