aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo Zimmermann2018-05-29 15:04:39 +0200
committerThéo Zimmermann2018-05-29 15:04:39 +0200
commit0c70c555f74cab5015f0e51a7fe48613c13b83f7 (patch)
treefcd6acd3a47c5067444f0e7d0efea53ac09945db
parentba809fa844b517e8a3606d9f6a6cac22e5585e27 (diff)
parent9b4e7dc0ed05dbfbb96177124a6394345feee67e (diff)
Merge PR #7626: Test for #7333 (soundness with VM/native and cofix)
-rw-r--r--test-suite/bugs/7333.v39
1 files changed, 39 insertions, 0 deletions
diff --git a/test-suite/bugs/7333.v b/test-suite/bugs/7333.v
new file mode 100644
index 0000000000..fba5b9029d
--- /dev/null
+++ b/test-suite/bugs/7333.v
@@ -0,0 +1,39 @@
+Module Example1.
+
+CoInductive wrap : Type :=
+ | item : unit -> wrap.
+
+Definition extract (t : wrap) : unit :=
+match t with
+| item x => x
+end.
+
+CoFixpoint close u : unit -> wrap :=
+match u with
+| tt => item
+end.
+
+Definition table : wrap := close tt tt.
+
+Eval vm_compute in (extract table).
+Eval vm_compute in (extract table).
+
+End Example1.
+
+Module Example2.
+
+Set Primitive Projections.
+CoInductive wrap : Type :=
+ item { extract : unit }.
+
+CoFixpoint close u : unit -> wrap :=
+match u with
+| tt => item
+end.
+
+Definition table : wrap := close tt tt.
+
+Eval vm_compute in (extract table).
+Eval vm_compute in (extract table).
+
+End Example2.