invalid output when deriving instances for an associated newtype family instance #207
Labels
No Label
blocked: dependency
blocked: info-needed
bug
duplicate
enhancement
fixed in HEAD
help wanted
hs:arrows
hs:brackets
hs:classes
hs:comments
hs:do-notation
hs:guards
hs:lists
hs:operators
hs:patterns
hs:records
hs:types
invalid
language extension support
layouting
needs confirmation
priority: high
priority: low
question
revisit before next release
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: hexagoxel/brittany#207
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Trying to format a typeclass instance which includes data-family declarations and getting:
Brittany error - invalid outputIt looks like it's specifically
derivingon anewtypethat causes it to break. Updated with a MWE. PTALSeems like this only affects
newtypes. Changing it todataworks as expected.I ran into this not with
derivingbut with nesting the field selector on the next line. This module spits out aERROR: brittany pretty printer returned syntactically invalid result:With
--output-on-errors, I'm getting:Note that the position of the braces is now a syntax error.
@tfausak happy to file a separate bug or just pile onto this one
Seems like it's probably the same root cause.
uh oh
4b673d1d9d/src/Language/Haskell/Brittany/Internal/Layouters/Decl.hs (L1038-L1041)