Skip to content

HLS hangs in file with typed hole #4242

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

Closed
andriusstank opened this issue May 19, 2024 · 5 comments
Closed

HLS hangs in file with typed hole #4242

andriusstank opened this issue May 19, 2024 · 5 comments
Labels
type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@andriusstank
Copy link

HLS seems to loop forever typechecking certain code.

I have GHC 9.8.2 and HLS 2.8.0.0, both installed by GHCup on Fedora 33 system.

Heres' complete code to reproduce the issue:

{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE QuantifiedConstraints #-}
{-# LANGUAGE TypeOperators #-}
module MyLib where

type family F a

class F a ~ F b => C a b

f :: (forall x. C x x) => ()
f y = _

I run haskell-language-server-9.8.2~2.8.0.0 MyLib.hs on command line and it hangs, consuming 100% cpu. If I change this code just about any way, HLS correctly reports errors and exits. GHC also correctly handles this code, reporting type errors.

@andriusstank andriusstank added status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels May 19, 2024
@michaelpj
Copy link
Collaborator

Possible duplicate? #2731

@michaelpj
Copy link
Collaborator

If it's to do with the hole

@andriusstank
Copy link
Author

It's about the hole, I didn't succeed hanging HLS without it. I just tried the code from #2731, HLS quickly inferred the hole, so this must be a different issue.

@michaelpj michaelpj changed the title HLS hangs HLS hangs in file with typed hole May 19, 2024
@michaelpj
Copy link
Collaborator

We now limit the hole fits, which I hope should fix this.

@fendor
Copy link
Collaborator

fendor commented Jun 26, 2024

Closed by #4288, could you check your issue is indeed solved in the latest release?

@fendor fendor closed this as completed Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

3 participants