diff options
author | david.waern <david.waern@gmail.com> | 2010-03-18 22:22:27 +0000 |
---|---|---|
committer | david.waern <david.waern@gmail.com> | 2010-03-18 22:22:27 +0000 |
commit | 629ff801073bb90a968dbc882b0c443d13e4d92e (patch) | |
tree | 1c3da3f3263700813ee55c046d00ea1956d4fdd5 /src/Haddock/GhcUtils.hs | |
parent | accca44fea8b531d27df063f403abbe4303d6ddc (diff) |
Fix build with GHC 6.12.1
Diffstat (limited to 'src/Haddock/GhcUtils.hs')
-rw-r--r-- | src/Haddock/GhcUtils.hs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/Haddock/GhcUtils.hs b/src/Haddock/GhcUtils.hs index 5c481586..c0d6707c 100644 --- a/src/Haddock/GhcUtils.hs +++ b/src/Haddock/GhcUtils.hs @@ -90,10 +90,18 @@ isVarSym = isLexVarSym . occNameFS getMainDeclBinder :: HsDecl name -> Maybe name getMainDeclBinder (TyClD d) = Just (tcdName d) -getMainDeclBinder (ValD d) - = case collectHsBindBinders d of - [] -> Nothing - (name:_) -> Just name +getMainDeclBinder (ValD d) = +#if __GLASGOW_HASKELL__ == 612 + case collectAcc d [] of + [] -> Nothing + (name:_) -> Just (unLoc name) +#else + case collectHsBindBinders d of + [] -> Nothing + (name:_) -> Just name +#endif + + getMainDeclBinder (SigD d) = sigNameNoLoc d getMainDeclBinder (ForD (ForeignImport name _ _)) = Just (unLoc name) getMainDeclBinder (ForD (ForeignExport _ _ _)) = Nothing |