Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Rodrigo Oliveira
Rohit Grover
Rui Barreiro
Ruslan Feizerahmanov
spikedoanz
Sam Phillips
Simon Chatterjee
Stefan Höck
Expand Down
11 changes: 11 additions & 0 deletions tests/idris2/reg/reg060/CoDataEta.idr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
tabulate : (Nat -> a) -> Stream a
tabulate f = f 0 :: tabulate (f . S)

index : Stream a -> Nat -> a
index (x :: _) Z = x
index (_ :: xs) (S n) = index xs n

lemma : (f : Nat -> Nat)
-> (k : Nat)
-> index (tabulate (f . S)) k = index (tabulate (\m => f (S m))) k
lemma f k = Refl
1 change: 1 addition & 0 deletions tests/idris2/reg/reg060/expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1/1: Building CoDataEta (CoDataEta.idr)
11 changes: 11 additions & 0 deletions tests/idris2/reg/reg060/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
. ../../../testutils.sh

# This test must complete within 5 seconds.
# Without the fix for codata unification, it would hang indefinitely
# trying to unify eta-equivalent functions in codata context.
timeout 5 $idris2 --no-banner --no-color --console-width 0 --check CoDataEta.idr

if [ $? -eq 124 ]; then
echo "TIMEOUT: Unification hung (this indicates the bug is present)"
exit 1
fi