Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Totality annotations are ignored #91

Open
ohad opened this issue Aug 21, 2019 · 3 comments
Open

Totality annotations are ignored #91

ohad opened this issue Aug 21, 2019 · 3 comments

Comments

@ohad
Copy link

ohad commented Aug 21, 2019

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
@edwinb
Copy link
Owner

edwinb commented Aug 21, 2019

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

@ohad
Copy link
Author

ohad commented Aug 21, 2019

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

@mx00s
Copy link

mx00s commented Apr 4, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants