Idris2-boot icon indicating copy to clipboard operation
Idris2-boot copied to clipboard

Totality annotations are ignored

Open ohad opened this issue 5 years ago • 3 comments

Steps to Reproduce

run idris2 totality.idr where totality.idr is:

total
foo : a
foo = foo

Expected Behavior

- + Errors (1)
 `-- totality.idr line 3 col 0:
     Main.foo is possibly not total due to recursive path Main.foo --> Main.foo

Observed Behavior

$ idris2 totality.idr 
1/1: Building totality (totality.idr)
Welcome to Idris 2 version 0.0. Enjoy yourself!
Main> :total foo
Main.foo is not terminating due to recursive path Main.foo

ohad avatar Aug 21 '19 07:08 ohad

Yes, indeed, they are :). I should probably get around to implementing this sooner rather than later...

edwinb avatar Aug 21 '19 13:08 edwinb

Thanks --- definitely not blocking me, just filing it for future reference.

ohad avatar Aug 21 '19 13:08 ohad

Is there a target version for this fix?

I was surprised to see unhandled cases, in addition to unproductive self-reference, aren't checked. For example,

total
vadd : Num a => Vect n a -> Vect n a
vadd [] = []
-- vadd (x :: xs) = x :: xs

mx00s avatar Apr 04 '20 00:04 mx00s