Failing on top level template haskell splices #70
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#70
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?
For some reason
brittany
is failing to print exact for top levelsplices. This may be an issue in
brittany
orghc-exact-print
, I'mnot sure. I've added failing tests to highlight this issue. This bug
causes
brittany
to produce syntactically invalid Haskell.I have found the cause of this. The filtering of annotations per top-level decl throws away one annotation connected to the
Unqual
identifier that is in''AssignmentPost
. I am a bit confused that this part of the syntax tree even has an Annotation, because it cannot have an AnnKey.I'll investigate this a bit more; however there already would be a brute-force fix: Don't filter annotation for externally-printed top-level decls.
Oh awesome. I was just trying to repro this in
ghc-exactprint
the other night. 🎉Should be fixed. In theory this fix is a bit sloppy because we should calculate some transitive closure in
extractToplevelAnns
. But as rarely asannCapturedSpan
seems to be used, I'll take that risk.