Skip to content

Commit 8185b1c

Browse files
FinleyMcIlwainebgamari
authored andcommitted
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.
1 parent 3d1d42b commit 8185b1c

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

compiler/GHC/Hs/Doc.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ type LHsDoc pass = Located (HsDoc pass)
123123
data DocStructureItem
124124
= DsiSectionHeading !Int !(HsDoc GhcRn)
125125
| DsiDocChunk !(HsDoc GhcRn)
126-
| DsiNamedChunkRef !(String)
126+
| DsiNamedChunkRef !String
127127
| DsiExports !Avails
128128
| DsiModExport
129129
!(NonEmpty ModuleName) -- ^ We might re-export avails from multiple

compiler/GHC/HsToCore/Docs.hs

+7-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,13 @@ mkDocStructureFromDecls env all_exports decls =
192192
Just loc -> L loc (DsiExports [avail])
193193
-- FIXME: This is just a workaround that we use when handling e.g.
194194
-- associated data families like in the html-test Instances.hs.
195-
Nothing -> noLoc (DsiExports [avail])
195+
Nothing -> noLoc (DsiExports [])
196+
197+
-- This causes the associated data family to be incorrectly documented
198+
-- separately from its class:
199+
-- Nothing -> noLoc (DsiExports [avail])
200+
201+
-- This panics on the associated data family:
196202
-- Nothing -> panicDoc "mkDocStructureFromDecls: No loc found for"
197203
-- (ppr avail)
198204

utils/haddock

Submodule haddock updated from 2c6ce80 to bfb52ad

0 commit comments

Comments
 (0)