Idris2/tests/idris2/total011/Issue1782.idr
Guillaume ALLAIS 13ef8ba707 [ fix #1782 ] remove the case-specific code
I can't make sense of this code, it seems to try to convert the
case function corresponding to `let (a, b) = f n in ...` into a
different case function where `f n` and `(a, b)` have been unified.
But if `f n` is a bona fide stuck computation, there's no chance of
this happening.

Just turning this off solves the #1782 and only breaks one function
in the whole of the idris2 repo (I would have expected our current
termination oracle to be too weak to detect it as valid anyway!)
and one in frex (which, again, should not have been seen as terminating).

Also fixes #1460
2021-07-26 17:03:16 +01:00

12 lines
227 B
Idris

total
notHack : Nat -> (Nat, Nat)
notHack Z = (Z, Z)
notHack (S n) = let (baz1, baz2) = notHack n
in (baz2, S baz1)
total
hack : Nat -> (Void, Void)
hack n = let (baz1, baz2) = hack n
in (baz1, baz2)