Skip to content
Snippets Groups Projects
Commit 8185b1c2 authored by Finley McIlwaine's avatar Finley McIlwaine Committed by Ben Gamari
Browse files

Fix associated data family doc structure items

Associated data families were being given their own export DocStructureItems,
which resulted in them being documented separately from their classes in
haddocks. This commit fixes it.
parent 3d1d42b7
No related branches found
No related tags found
No related merge requests found
......@@ -123,7 +123,7 @@ type LHsDoc pass = Located (HsDoc pass)
data DocStructureItem
= DsiSectionHeading !Int !(HsDoc GhcRn)
| DsiDocChunk !(HsDoc GhcRn)
| DsiNamedChunkRef !(String)
| DsiNamedChunkRef !String
| DsiExports !Avails
| DsiModExport
!(NonEmpty ModuleName) -- ^ We might re-export avails from multiple
......
......@@ -192,7 +192,13 @@ mkDocStructureFromDecls env all_exports decls =
Just loc -> L loc (DsiExports [avail])
-- FIXME: This is just a workaround that we use when handling e.g.
-- associated data families like in the html-test Instances.hs.
Nothing -> noLoc (DsiExports [avail])
Nothing -> noLoc (DsiExports [])
-- This causes the associated data family to be incorrectly documented
-- separately from its class:
-- Nothing -> noLoc (DsiExports [avail])
-- This panics on the associated data family:
-- Nothing -> panicDoc "mkDocStructureFromDecls: No loc found for"
-- (ppr avail)
......
Subproject commit 2c6ce8063c975602761cf0ae121200fe9c166148
Subproject commit bfb52adefa028f541672623321eb1b3d21dd2547
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment