haskell-ide-engine
haskell-ide-engine copied to clipboard
Hlint parse error with RecordWildCards language extension
Minimal example (app/Main.hs file in standard stack's new
template):
{-# LANGUAGE RecordWildCards #-}
data Foo a = Foo {foo :: a, bar :: a}
fun :: Foo a -> a
fun f @ Foo{..} = foo
main :: IO ()
main = pure ()
And it throws such error:
[hlint parser] [I] /tmp/haskell-lsp5450/Main.hs-00023--8855030527756882730.hs:6:12: error:
parse error on input `{'
fun :: Foo a -> a
> fun f @ Foo{..} = foo
main :: IO ()
Screenshot (I'm using NeoVim with coc.nvim):
Coc.nvim settings copied from README.
HIE version:
$ hie --version
Version 1.1, Git revision 49c6185efdec715a4b2954efa7887520f7196cc8 (3775 commits) x86_64 ghc-8.6.5
I believe this is an underlying bug in haskell-src-exts, and an underlying bug in HLInt. If you change it to:
fun f@Foo{..} = foo
The bug should go away. Furthermore, work is being done to eliminate haskell-src-exts, which will solve this problem for good.