hindent icon indicating copy to clipboard operation
hindent copied to clipboard

Indenting class creates syntax error

Open lorenzo opened this issue 7 years ago • 4 comments

Trying to indent this snippet

-- | Foo
class GToJSON enc arity f where
    -- | Bar
  gToJSON :: Options -> ToArgs enc arity a -> f a -> enc

Produces

-- | Foo
class GToJSON enc arity f
    -- | Bar
  | 
  where
  gToJSON :: Options -> ToArgs enc arity a -> f a -> enc

Which makes the code not compile anymore.

lorenzo avatar Jul 15 '17 22:07 lorenzo

This is probably a symptom of https://github.com/commercialhaskell/hindent/issues/400 but looks like recent changes made it also output a syntax error

lorenzo avatar Jul 15 '17 22:07 lorenzo

The error appears after the commit https://github.com/commercialhaskell/hindent/commit/f20fee27cb6d936bd6a5d2b796ae060e0044ebf2

lorenzo avatar Jul 15 '17 23:07 lorenzo

Thanks for your reporting!

sighingnow avatar Jul 16 '17 03:07 sighingnow

+1

NorfairKing avatar Aug 19 '17 16:08 NorfairKing

Closing as the current master formats the input correctly.

toku-sa-n avatar Apr 23 '23 13:04 toku-sa-n