X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Frename%2FRnNames.lhs;h=71890dba2406a476389058ce0709d8ba49f49764;hp=8f6d158bd659e2c0179ce819968a0dd3f36767fe;hb=a835e9faf19400aa6b7999b6f64e60cb1c7737dd;hpb=24bb49b71bce13faa263386e68d49fc0b05557b7 diff --git a/compiler/rename/RnNames.lhs b/compiler/rename/RnNames.lhs index 8f6d158..71890db 100644 --- a/compiler/rename/RnNames.lhs +++ b/compiler/rename/RnNames.lhs @@ -447,13 +447,18 @@ getLocalDeclBinders gbl_env (HsGroup {hs_valds = ValBindsIn val_decls val_sigs, for_hs_bndrs = [nm | L _ (ForeignImport nm _ _) <- foreign_decls] new_tc tc_decl + | isIdxTyDecl (unLoc tc_decl) + = do { main_name <- lookupFamInstDeclBndr mod main_rdr + ; sub_names <- + mappM (newTopSrcBinder mod (Just main_name)) sub_rdrs + ; return sub_names } -- main_name is not declared here! + | otherwise = do { main_name <- newTopSrcBinder mod Nothing main_rdr - ; sub_names <- mappM (newTopSrcBinder mod (Just main_name)) sub_rdrs - ; if isIdxTyDecl (unLoc tc_decl) -- index type definitions - then return ( sub_names) -- are usage occurences - else return (main_name : sub_names) } - where - (main_rdr : sub_rdrs) = tyClDeclNames (unLoc tc_decl) + ; sub_names <- + mappM (newTopSrcBinder mod (Just main_name)) sub_rdrs + ; return (main_name : sub_names) } + where + (main_rdr : sub_rdrs) = tyClDeclNames (unLoc tc_decl) inst_ats inst_decl = mappM new_tc (instDeclATs (unLoc inst_decl))