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

Silent failure when using -XBangPatterns #321

Open
emlautarom1 opened this issue Nov 9, 2020 · 0 comments
Open

Silent failure when using -XBangPatterns #321

emlautarom1 opened this issue Nov 9, 2020 · 0 comments

Comments

@emlautarom1
Copy link

There are some cases where formatting silently fails when -XBangPatterns is enabled.

Some examples:

{-# LANGUAGE BangPatterns #-}

-- These work
data Example = Example {-# UNPACK #-} !Int

data Example1 
  = Example1 {-# UNPACK #-} !Int

-- These fail
data ExampleFail 
  = ExampleFail 
    {-# UNPACK #-} !Int

data ExampleFail2
  = ExampleFail2
  {-# UNPACK #-} !Int

The CLI does not complain, but when using hls on Visual Studio Code you can see in the output tab the following message from hls:

[Error - 12:07:48 PM] Request textDocument/formatting failed.
  Message: brittanyCmd: HsBangTy{}
HsBangTy{}
HsBangTy{}
HsBangTy{}
HsBangTy{}
HsBangTy{}
HsBangTy{}
HsBangTy{}

  Code: -32602
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