Skip to content

Commit

Permalink
Fixes #12322 (anomaly when printing "fun" binders with implicit types).
Browse files Browse the repository at this point in the history
A pattern-matching clause was missing in 5f31403 (PR #11261).

The anomaly triggered in configurations like "fun (x:T) y => ..."
(even in the absence of "Implicit Types").
  • Loading branch information
herbelin committed May 14, 2020
1 parent 91b5990 commit 6a85fd4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion interp/constrextern.ml
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ let rec flatten_application c = match DAst.get c with

let same_binder_type ty nal c =
match nal, DAst.get c with
| _::_, GProd (_,_,ty',_) -> glob_constr_eq ty ty'
| _::_, (GProd (_,_,ty',_) | GLambda (_,_,ty',_)) -> glob_constr_eq ty ty'
| [], _ -> true
| _ -> assert false

Expand Down
6 changes: 6 additions & 0 deletions test-suite/output/ImplicitTypes.out
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ forall b1 b2, b1 = b2
: Prop
fun b => b = b
: bool -> Prop
fun b c : bool => b = c
: bool -> bool -> Prop
fun c b : bool => b = c
: bool -> bool -> Prop
fun b1 b2 => b1 = b2
: bool -> bool -> Prop
fix f b (n : nat) {struct n} : bool :=
match n with
| 0 => b
Expand Down
3 changes: 3 additions & 0 deletions test-suite/output/ImplicitTypes.v
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ Check forall b1 b2, b1 = b2.

(* Check in "fun" *)
Check fun b => b = b.
Check fun b c => b = c.
Check fun c b => b = c.
Check fun b1 b2 => b1 = b2.

(* Check in binders *)
Check fix f b n := match n with 0 => b | S p => f b p end.
Expand Down

0 comments on commit 6a85fd4

Please sign in to comment.