From 9db74caf09e2e0a5387d63499de87579d83835cb Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Wed, 25 Jan 2006 09:09:57 +0000 Subject: [PATCH] Fix conDeclFVs for GADTs, to fix bogus unused-import warning --- ghc/compiler/rename/RnHsSyn.lhs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ghc/compiler/rename/RnHsSyn.lhs b/ghc/compiler/rename/RnHsSyn.lhs index 8143a52..6752218 100644 --- a/ghc/compiler/rename/RnHsSyn.lhs +++ b/ghc/compiler/rename/RnHsSyn.lhs @@ -117,17 +117,15 @@ hsSigFVs (SpecSig v ty inl) = extractHsTyNames ty hsSigFVs other = emptyFVs ---------------- --- XXX - autrijus - handle return type for GADT -conDeclFVs (L _ (ConDecl _ _ tyvars context details _)) +conDeclFVs (L _ (ConDecl { con_qvars = tyvars, con_cxt = context, + con_details = details, con_res = res_ty})) = delFVs (map hsLTyVarName tyvars) $ - extractHsCtxtTyNames context `plusFV` - conDetailsFVs details + extractHsCtxtTyNames context `plusFV` + conDetailsFVs details `plusFV` + conResTyFVs res_ty -{- --- gaw 2004 -conDeclFVs (L _ (GadtDecl _ ty)) - = extractHsTyNames ty --} +conResTyFVs ResTyH98 = emptyFVs +conResTyFVs (ResTyGADT ty) = extractHsTyNames ty conDetailsFVs (PrefixCon btys) = plusFVs (map bangTyFVs btys) conDetailsFVs (InfixCon bty1 bty2) = bangTyFVs bty1 `plusFV` bangTyFVs bty2 -- 1.7.10.4