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

Basic totality/coverage checking failure #4779

Open
MarcelineVQ opened this issue Nov 13, 2019 · 0 comments
Open

Basic totality/coverage checking failure #4779

MarcelineVQ opened this issue Nov 13, 2019 · 0 comments

Comments

@MarcelineVQ
Copy link
Contributor

MarcelineVQ commented Nov 13, 2019

Idris ver 1.3.2-git:9549d9cb9

Steps to Reproduce

Check the following for totality via: :total foo

data Id a = MkId a
foo : (f : List a) -> Id (NonEmpty f) -> List a
foo (x :: xs) (MkId IsNonEmpty) = []

Expected Behavior

Expect foo to be covering and total.

Observed Behavior

Idris reports that foo does not cover all cases and :missing shows that the [] case for f is missing.

Writing

foo : (f : List a) -> NonEmpty f -> List a
foo (x :: xs) IsNonEmpty = []

is covering/total as one should expect, it is surprising for a straightforward wrapper to cause this.

This issue was discovered while checking totality on the following and minimized to Id for the example.

foo : (f : List a) -> (g : List a) -> Either (NonEmpty f) (NonEmpty g) -> List a
foo (x :: xs) ys (Left IsNonEmpty) = []
foo xs (y :: ys) (Right IsNonEmpty) = []
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

1 participant