aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Backends/Xhtml/Utils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Haddock/Backends/Xhtml/Utils.hs')
-rw-r--r--src/Haddock/Backends/Xhtml/Utils.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Haddock/Backends/Xhtml/Utils.hs b/src/Haddock/Backends/Xhtml/Utils.hs
index c250f5eb..7ba6d5f4 100644
--- a/src/Haddock/Backends/Xhtml/Utils.hs
+++ b/src/Haddock/Backends/Xhtml/Utils.hs
@@ -37,7 +37,7 @@ import Data.Maybe
import Text.XHtml hiding ( name, title, p, quote )
import qualified Text.XHtml as XHtml
-import GHC ( SrcSpan, srcSpanStartLine, Name )
+import GHC ( SrcSpan(..), srcSpanStartLine, Name )
import Module ( Module )
import Name ( getOccString, nameOccName, isValOcc )
@@ -59,7 +59,12 @@ spliceURL maybe_file maybe_mod maybe_name maybe_loc url = run url
line = case maybe_loc of
Nothing -> ""
- Just span_ -> show $ srcSpanStartLine span_
+ Just span_ ->
+ case span_ of
+ RealSrcSpan span__ ->
+ show $ srcSpanStartLine span__
+ UnhelpfulSpan _ ->
+ error "spliceURL UnhelpfulSpan"
run "" = ""
run ('%':'M':rest) = mdl ++ run rest