diff options
author | Hugo Herbelin <Hugo.Herbelin@inria.fr> | 2014-10-22 10:32:45 +0200 |
---|---|---|
committer | Hugo Herbelin <Hugo.Herbelin@inria.fr> | 2014-10-22 11:04:30 +0200 |
commit | 2592ea6490cdf799432260c99a934605a2739849 (patch) | |
tree | 11f8e09fd434270694090194eebe708cefdfef11 /test-suite/success | |
parent | c25ff7718d77e4aba0827c4d45a507ed49db72e0 (diff) |
Fixing an evar leak in pattern-matching compilation (#3758).
Diffstat (limited to 'test-suite/success')
-rw-r--r-- | test-suite/success/Cases-bug3758.v | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test-suite/success/Cases-bug3758.v b/test-suite/success/Cases-bug3758.v new file mode 100644 index 000000000..e48f45232 --- /dev/null +++ b/test-suite/success/Cases-bug3758.v @@ -0,0 +1,17 @@ +(* There used to be an evar leak in the to_nat example *) + +Require Import Coq.Lists.List. +Import ListNotations. + +Fixpoint Idx {A:Type} (l:list A) : Type := + match l with + | [] => False + | _::l => True + Idx l + end. + +Fixpoint to_nat {A:Type} (l:list A) (i:Idx l) : nat := + match l,i with + | [] , i => match i with end + | _::_, inl _ => 0 + | _::l, inr i => S (to_nat l i) + end. |