X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Frename%2FRnEnv.lhs;h=825ed19fc230bc100e637db880a9da54459073a0;hb=25f0bf0245a59268fbfa8dc4ee4986b65c79ed16;hp=3587093cb982f7a3c54eb16f7467b0e8111e1f73;hpb=4e0c994eb1613c62e94069642d7acdb2e69b773b;p=ghc-hetmet.git diff --git a/compiler/rename/RnEnv.lhs b/compiler/rename/RnEnv.lhs index 3587093..825ed19 100644 --- a/compiler/rename/RnEnv.lhs +++ b/compiler/rename/RnEnv.lhs @@ -551,21 +551,21 @@ lookupBindGroupOcc :: Maybe NameSet -- See notes on the (Maybe NameSet) -- -- See Note [Looking up signature names] lookupBindGroupOcc mb_bound_names what rdr_name - = do { local_env <- getLocalRdrEnv - ; case lookupLocalRdrEnv local_env rdr_name of - Just n -> check_local_name n - Nothing -> do -- Not defined in a nested scope + = do { local_env <- getLocalRdrEnv + ; case lookupLocalRdrEnv local_env rdr_name of { + Just n -> check_local_name n; + Nothing -> do -- Not defined in a nested scope { env <- getGlobalRdrEnv - ; let gres = lookupGlobalRdrEnv env (rdrNameOcc rdr_name) - ; case (filter isLocalGRE gres) of - (gre:_) -> check_local_name (gre_name gre) - -- If there is more than one local GRE for the - -- same OccName 'f', that will be reported separately - -- as a duplicate top-level binding for 'f' - [] | null gres -> bale_out_with empty - | otherwise -> bale_out_with import_msg - }} + ; let gres = lookupGlobalRdrEnv env (rdrNameOcc rdr_name) + ; case (filter isLocalGRE gres) of + (gre:_) -> check_local_name (gre_name gre) + -- If there is more than one local GRE for the + -- same OccName 'f', that will be reported separately + -- as a duplicate top-level binding for 'f' + [] | null gres -> bale_out_with empty + | otherwise -> bale_out_with import_msg + }}} where check_local_name name -- The name is in scope, and not imported = case mb_bound_names of