aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2017-07-02 11:12:01 +0100
committerAlex Biehl <alexbiehl@gmail.com>2017-07-02 12:12:01 +0200
commit901b327f46dc4bd70cd310ae2c6339aa9ce572bb (patch)
tree142d0b0cf1c2a4acac3471617f45b8884ed73adb /haddock-api/src/Haddock/Backends
parentaf3e6c7c027389df18b15ee9a9d72ffc97dc1852 (diff)
Fix haddock: internal error: links: UnhelpfulSpan (#561)
* Fix haddock: internal error: links: UnhelpfulSpan This fixes #554 for me. I believe this is another fall out of `wildcard-refactor`, like #549. * Comment to clarify why we take the methods name location
Diffstat (limited to 'haddock-api/src/Haddock/Backends')
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Decl.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
index 716050fa..cda0611a 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
@@ -635,8 +635,10 @@ ppInstanceSigs :: LinksInfo -> Splice -> Unicode -> Qualification
ppInstanceSigs links splice unicode qual sigs = do
TypeSig lnames typ <- sigs
let names = map unLoc lnames
- L loc rtyp = hsSigWcType typ
- return $ ppSimpleSig links splice unicode qual loc names rtyp
+ L _ rtyp = hsSigWcType typ
+ -- Instance methods signatures are synified and thus don't have a useful
+ -- SrcSpan value. Use the methods name location instead.
+ return $ ppSimpleSig links splice unicode qual (getLoc $ head $ lnames) names rtyp
lookupAnySubdoc :: Eq id1 => id1 -> [(id1, DocForDecl id2)] -> DocForDecl id2