From 7cfc4e5146be5666419451bdd516f1f3f264d24a Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Sun, 25 Jan 2015 14:42:51 +0100 Subject: Imported Upstream version 8.5~beta1+dfsg --- test-suite/success/Cases-bug3758.v | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test-suite/success/Cases-bug3758.v (limited to 'test-suite/success/Cases-bug3758.v') diff --git a/test-suite/success/Cases-bug3758.v b/test-suite/success/Cases-bug3758.v new file mode 100644 index 00000000..e48f4523 --- /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. -- cgit v1.2.3