[commit: haddock] 2.17.3.1-spanfix, alexbiehl-patch-1, ghc-8.0, ghc-head, ghc-head1, headdock-library-1.4.5, ie_avails, master, pr-filter-maps, pr/cabal-desc, travis, v2.17, v2.17.3, v2.18, wip/new-tree-one-param, wip/rae, wip/remove-frames, wip/remove-frames1, wip/revert-ttg-2017-11-20, wip/ttg-2017-10-13, wip/ttg-2017-10-31, wip/ttg-2017-11-06, wip/ttg2-2017-11-10, wip/ttg3-2017-11-12, wip/ttg4-constraints-2017-11-13: Don't consider default class ops when looking for decls (6193f6d)

git at git.haskell.org git at git.haskell.org
Mon Nov 20 21:02:38 UTC 2017


Repository : ssh://git@git.haskell.org/haddock

On branches: 2.17.3.1-spanfix,alexbiehl-patch-1,ghc-8.0,ghc-head,ghc-head1,headdock-library-1.4.5,ie_avails,master,pr-filter-maps,pr/cabal-desc,travis,v2.17,v2.17.3,v2.18,wip/new-tree-one-param,wip/rae,wip/remove-frames,wip/remove-frames1,wip/revert-ttg-2017-11-20,wip/ttg-2017-10-13,wip/ttg-2017-10-31,wip/ttg-2017-11-06,wip/ttg2-2017-11-10,wip/ttg3-2017-11-12,wip/ttg4-constraints-2017-11-13
Link       : http://git.haskell.org/haddock.git/commitdiff/6193f6d07f380436048928182ef511f167909a53

>---------------------------------------------------------------

commit 6193f6d07f380436048928182ef511f167909a53
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Sun May 22 12:42:23 2016 +0200

    Don't consider default class ops when looking for decls
    
    When we are looking for an operation within a class we don't care about
    `default`-type declarations. This was the cause of #505.


>---------------------------------------------------------------

6193f6d07f380436048928182ef511f167909a53
 haddock-api/src/Haddock/Interface/Create.hs | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs
index 8d561d6..e0b52cb 100644
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@ -783,8 +783,13 @@ extractDecl name mdl decl
   | otherwise  =
     case unLoc decl of
       TyClD d at ClassDecl {} ->
-        let matches = [ sig | sig <- tcdSigs d, name `elem` sigName sig,
-                        isTypeLSig sig ] -- TODO: document fixity
+        let matches = [ lsig
+                      | lsig <- tcdSigs d
+                      , ClassOpSig False _ _ <- pure $ unLoc lsig
+                        -- Note: exclude `default` declarations (see #505)
+                      , name `elem` sigName lsig
+                      ]
+            -- TODO: document fixity
         in case matches of
           [s0] -> let (n, tyvar_names) = (tcdName d, tyClDeclTyVars d)
                       L pos sig = addClassContext n tyvar_names s0



More information about the ghc-commits mailing list