X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2FhsSyn%2FHsUtils.lhs;h=b0978ec6494b5f296fb2b6d07a0af9a6782ec735;hb=85eebc52605f5fd4d3bbdb1a37f7134948f740ca;hp=5d7132ec74399dccfd54752de134ba4f18b925b6;hpb=190f24892156953d73b55401d0467a6f1a88ce5d;p=ghc-hetmet.git diff --git a/compiler/hsSyn/HsUtils.lhs b/compiler/hsSyn/HsUtils.lhs index 5d7132e..b0978ec 100644 --- a/compiler/hsSyn/HsUtils.lhs +++ b/compiler/hsSyn/HsUtils.lhs @@ -428,7 +428,10 @@ collect_pat other acc = acc -- Literals, vars, wildcard getMainDeclBinder :: HsDecl name -> Maybe name getMainDeclBinder (TyClD d) = Just (tcdName d) -getMainDeclBinder (ValD d) = Just ((unLoc . head) (collectAcc d [])) +getMainDeclBinder (ValD d) + = case collectAcc d [] of + [] -> Nothing -- see rn003 + (name:_) -> Just (unLoc name) getMainDeclBinder (SigD d) = sigNameNoLoc d getMainDeclBinder (ForD (ForeignImport name _ _)) = Just (unLoc name) getMainDeclBinder (ForD (ForeignExport name _ _)) = Just (unLoc name)