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

Interaction of totality and coverage checking #3437

Open
danelahman opened this issue Dec 9, 2024 · 2 comments
Open

Interaction of totality and coverage checking #3437

danelahman opened this issue Dec 9, 2024 · 2 comments

Comments

@danelahman
Copy link

Consider the following code snippets

%default total

covering
f : Int -> Int
f i = f i
total
covering
f : Int -> Int
f i = f i

Steps to Reproduce

Using idris2--0.7.0_3.arm64_sonoma on MacOS Sonoma 14.7.1 installed via Homebrew.

Expected Behavior

In both cases, I would expect to still get an error message about the function f not being total (being nonterminating):

Error: f is not total, possibly not terminating due to recursive path Main.f

Observed Behavior

No error message about f not being total (being nonterminating), neither using CLI nor using the Idris Language VS Code plugin.

@gallais
Copy link
Member

gallais commented Dec 9, 2024

In the first example I wouldn't expect such an error given that you purposefully overrode the default.

In the second example, I would expect an error message pointing out the incompatible totality annotations.

@spcfox
Copy link
Contributor

spcfox commented Dec 9, 2024

I tried to fix this: spcfox@238f914

But with this fix, the error about multiple totality modifiers occurs in the following code:

interface Inhabited a where
  total
  element : a

covering
Inhabited () where
  element = ()

Similar place in the compiler code:

Idris2/src/Core/Name.idr

Lines 264 to 265 in 826b7eb

covering
[Raw] Show Name where

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

No branches or pull requests

3 participants