From 342b0b39bc4a9ac6ddfa616bf7e965263ce78b50 Mon Sep 17 00:00:00 2001
From: sheaf <sam.derbyshire@gmail.com>
Date: Fri, 7 Jul 2023 13:45:12 +0200
Subject: [PATCH] Avoid incomplete record update in Haddock Hoogle
This commit avoids running into an incomplete record update warning
in the Hoogle backend of Haddock.
This was only noticed now, because incomplete record updates were broken
in GHC 9.6. Now that they are fixed, we have to avoid running into them!
(cherry picked from commit b96241bad1cd59c65a89dab74e6cba114129e521)
---
haddock-api/src/Haddock/Backends/Hoogle.hs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs
index 44bdb214e0..e0bc9380c8 100644
--- a/haddock-api/src/Haddock/Backends/Hoogle.hs
+++ b/haddock-api/src/Haddock/Backends/Hoogle.hs
@@ -192,7 +192,7 @@ pp_sig dflags names (L _ typ) =
-- note: does not yet output documentation for class methods
ppClass :: DynFlags -> TyClDecl GhcRn -> [(Name, DocForDecl Name)] -> [String]
-ppClass dflags decl subdocs =
+ppClass dflags decl@(ClassDecl {}) subdocs =
(ppDecl ++ ppTyFams) : ppMethods
where
ppDecl :: String
@@ -234,7 +234,7 @@ ppClass dflags decl subdocs =
, nest 4 . vcat . map (Outputable.<> semi) $ elems
, rbrace
]
-
+ppClass _ _non_cls_decl _ = []
ppFam :: DynFlags -> FamilyDecl GhcRn -> [String]
ppFam dflags decl@(FamilyDecl { fdInfo = info })
--
GitLab