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

Not a splittable variable #2181

Closed
andreasabel opened this issue Sep 12, 2016 · 5 comments
Closed

Not a splittable variable #2181

andreasabel opened this issue Sep 12, 2016 · 5 comments
Assignees
Labels
modules Issues relating to the module system parameter-refinement regression on master Unreleased regression in development version (Change to "regression in ..." should it be released!) type: bug Issues and pull requests about actual bugs ux: case splitting Issues relating to the case split ("C-c C-c") command with Problems with the "with" abstraction
Milestone

Comments

@andreasabel
Copy link
Member

data S : Set where
  c : S

module _ (A : Set) where
  test : S
  test with c
  ... | q = {!q!}

reports

Not a (splittable) variable: q
when checking that the expression ? has type q

The reported type looks also fishy. De Bruijn mess with module parameters?

Works fine with agda-2.5.1.1.

@andreasabel andreasabel added type: bug Issues and pull requests about actual bugs with Problems with the "with" abstraction modules Issues relating to the module system ux: case splitting Issues relating to the case split ("C-c C-c") command regression on master Unreleased regression in development version (Change to "regression in ..." should it be released!) labels Sep 12, 2016
@andreasabel andreasabel added this to the 2.5.2 milestone Sep 12, 2016
@andreasabel
Copy link
Member Author

In the debug output I get

Coverage checking Bug-Splittable._.with-14
  tel  = (w : S) (A : Set)

Thus, the with-variable preceeds the module parameters. The calculation which variables are interactively splittable (because not module parameters) should be more complicated now, as the module parameters can be shuffled arbitrarily into the argument vector by the with-abstraction.

@andreasabel
Copy link
Member Author

@UlfNorell: where does a function store which of its arguments are module parameters?
I pass this to you...

@UlfNorell
Copy link
Member

Hm, that didn't quite do it:

module _ (n : Nat) where

  foo : (m : Nat)  n ≡ m  Nat
  foo m refl = {!m!} -- not a splittable var: m

In this case the value of the module parameter is m so my fix gets confused.

@UlfNorell UlfNorell reopened this Sep 13, 2016
@UlfNorell
Copy link
Member

Actually, that's not the problem. The problem is that the m has been refined to a dot pattern and so is not available for splitting. This is no longer a regression wrt to 2.5.1 so I'll remove that label.

@UlfNorell UlfNorell removed the regression on master Unreleased regression in development version (Change to "regression in ..." should it be released!) label Sep 13, 2016
@UlfNorell
Copy link
Member

Fixing this would require a bit of work. I'll close this issue and add a fresh one for this feature.

@UlfNorell UlfNorell added the regression on master Unreleased regression in development version (Change to "regression in ..." should it be released!) label Sep 13, 2016
carlostome pushed a commit to carlostome/agda that referenced this issue Oct 11, 2016
carlostome pushed a commit to carlostome/agda that referenced this issue Oct 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modules Issues relating to the module system parameter-refinement regression on master Unreleased regression in development version (Change to "regression in ..." should it be released!) type: bug Issues and pull requests about actual bugs ux: case splitting Issues relating to the case split ("C-c C-c") command with Problems with the "with" abstraction
Projects
None yet
Development

No branches or pull requests

2 participants