From abdb6692d8be2250685e4d78cdd84711f4d493d6 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Thu, 21 Feb 2019 17:47:25 +0100 Subject: add test case for "match" --- test-suite/bugs/closed/bug_9598.v | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test-suite/bugs/closed/bug_9598.v (limited to 'test-suite') diff --git a/test-suite/bugs/closed/bug_9598.v b/test-suite/bugs/closed/bug_9598.v new file mode 100644 index 0000000000..917bf92a87 --- /dev/null +++ b/test-suite/bugs/closed/bug_9598.v @@ -0,0 +1,11 @@ +Module case. + + Inductive pair := K (n1 : nat) (n2 : nat). + Definition fst (p : pair) : nat := match p with K n _ => n end. + + Definition alias_K a b := K a b. + + Fixpoint rec (x : nat) : nat := fst (K 0 (rec x)). + Fixpoint rec_ko (x : nat) : nat := fst (alias_K 0 (rec_ko x)). + +End case. -- cgit v1.2.3 From 5ee6581330ac77596d31dddc1bf4fc09e585b1f6 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Fri, 22 Feb 2019 14:09:43 +0100 Subject: add testcase for fix --- test-suite/bugs/closed/bug_9598.v | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test-suite') diff --git a/test-suite/bugs/closed/bug_9598.v b/test-suite/bugs/closed/bug_9598.v index 917bf92a87..daf4d3f847 100644 --- a/test-suite/bugs/closed/bug_9598.v +++ b/test-suite/bugs/closed/bug_9598.v @@ -9,3 +9,15 @@ Module case. Fixpoint rec_ko (x : nat) : nat := fst (alias_K 0 (rec_ko x)). End case. + +Module fixpoint. + + Inductive pair := K (n1 : nat) (n2 : nat). + Fixpoint fst (p : pair) : nat := match p with K n _ => n end. + + Definition alias_K a b := K a b. + + Fixpoint rec (x : nat) : nat := fst (K 0 (rec x)). + Fixpoint rec_ko (x : nat) : nat := fst (alias_K 0 (rec_ko x)). + +End fixpoint. -- cgit v1.2.3 From 565cefdb051339a601b9977e163ee4ffbba75274 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Fri, 22 Feb 2019 14:10:18 +0100 Subject: add testcase for primitive projection --- test-suite/bugs/closed/bug_9598.v | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test-suite') diff --git a/test-suite/bugs/closed/bug_9598.v b/test-suite/bugs/closed/bug_9598.v index daf4d3f847..00bbfcf5d9 100644 --- a/test-suite/bugs/closed/bug_9598.v +++ b/test-suite/bugs/closed/bug_9598.v @@ -21,3 +21,16 @@ Module fixpoint. Fixpoint rec_ko (x : nat) : nat := fst (alias_K 0 (rec_ko x)). End fixpoint. + +Module primproj. + + Set Primitive Projections. + + Inductive pair := K { fst : nat; snd : nat }. + + Definition alias_K a b := K a b. + + Fixpoint rec (x : nat) : nat := fst (K 0 (rec x)). + Fixpoint rec_ko (x : nat) : nat := fst (alias_K 0 (rec_ko x)). + +End primproj. -- cgit v1.2.3