brittany
brittany copied to clipboard
Silent failure when using -XBangPatterns
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