stylish-haskell icon indicating copy to clipboard operation
stylish-haskell copied to clipboard

module_header formatting crashes on a qualified operator in the export list

Open nfrisby opened this issue 2 years ago • 0 comments

GHC parses it, but stylish crashes on it.

$ diff .stylish-haskell.yaml <(stylish-haskell --defaults | grep -Ev -e ' *#')
5d4
<   - module_header: {}

$ cat Test.hs
module Test ((Test.<=)) where

(<=) :: a -> b -> c
(<=) = undefined

$ stylish-haskell Test.hs
Test.hs: RealSrcSpan SrcSpanOneLine "Test.hs" 2 7 14: parse error on input `Test.<='


$ stylish-haskell --version
stylish-haskell 0.12.2.0

$ ghc Test.hs
[1 of 1] Compiling Test             ( Test.hs, Test.o )

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.10.4

FWIW, it also crashes if I set ghc_lib_parser: true. Thanks!

nfrisby avatar Jul 22 '21 00:07 nfrisby