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

:ac causes infinite loop #2255

Open
michaelmesser opened this issue Jan 9, 2022 · 1 comment
Open

:ac causes infinite loop #2255

michaelmesser opened this issue Jan 9, 2022 · 1 comment

Comments

@michaelmesser
Copy link
Contributor

michaelmesser commented Jan 9, 2022

Credit to Jean-Esther van Gobseck for discovering this issue
This causes the LSP to go into an infinite loop when producing code actions.

Steps to Reproduce

After loading this file:

extNat : {0 f, g : Nat -> b} -> ((x : Nat) -> f x = g x) -> f = g

in the REPL run:

Main> :ac 1 extNat

Expected Behavior

Return result or fail in less than 5 seconds

Observed Behavior

Never returns result

@gallais
Copy link
Member

gallais commented Jan 10, 2022

This is my understanding: the first explicit argument is a function so idris2 picks f
as a name and then chaos ensues because it's getting confused over the implicit vs.
explicit f. Strangely enough you don't even need f to show up in the return type for
idris to go into an infinite loop:

extNat : {0 f, g : Nat} -> Not (f = g) -> ()

If you use :ac on extNat : {0 f, g : Nat} -> Not (f = g) instead, idris picks prf
as the name for the argument of type f = g and everything is fine. If you go for
extNat : {0 prf, g : Nat} -> Not (prf = g) instead then you also get an infinite loop
presumably because of a similar prf/prf clash.

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

2 participants