X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Frename%2FRnEnv.lhs;h=4d2ee53892303ae7011d5f7ba13938e314e09221;hp=ae1966c8f36f3470c225bb7d130d531bd75e552f;hb=4385caba003064bb556f965b32fdc962ea19ea69;hpb=479f9fcbe056864fd5daff01d0e00d4a432b3658 diff --git a/compiler/rename/RnEnv.lhs b/compiler/rename/RnEnv.lhs index ae1966c..4d2ee53 100644 --- a/compiler/rename/RnEnv.lhs +++ b/compiler/rename/RnEnv.lhs @@ -11,7 +11,7 @@ module RnEnv ( lookupLocatedOccRn, lookupOccRn, lookupLocatedGlobalOccRn, lookupGlobalOccRn, lookupLocalDataTcNames, lookupSrcOcc_maybe, - lookupFixityRn, lookupTyFixityRn, lookupLocatedSigOccRn, + lookupFixityRn, lookupTyFixityRn, lookupInstDeclBndr, lookupRecordBndr, lookupConstructorFields, lookupSyntaxName, lookupSyntaxTable, lookupImportedName, lookupGreRn, lookupGreLocalRn, lookupGreRn_maybe, @@ -215,35 +215,6 @@ lookupTopBndrRn_maybe rdr_name Nothing -> returnM Nothing Just gre -> returnM (Just $ gre_name gre) } --- lookupLocatedSigOccRn is used for type signatures and pragmas --- Is this valid? --- module A --- import M( f ) --- f :: Int -> Int --- f x = x --- It's clear that the 'f' in the signature must refer to A.f --- The Haskell98 report does not stipulate this, but it will! --- So we must treat the 'f' in the signature in the same way --- as the binding occurrence of 'f', using lookupBndrRn --- --- However, consider this case: --- import M( f ) --- f :: Int -> Int --- g x = x --- We don't want to say 'f' is out of scope; instead, we want to --- return the imported 'f', so that later on the reanamer will --- correctly report "misplaced type sig". -lookupLocatedSigOccRn :: Located RdrName -> RnM (Located Name) -lookupLocatedSigOccRn = wrapLocM $ \ rdr_name -> do - { local_env <- getLocalRdrEnv - ; case lookupLocalRdrEnv local_env rdr_name of { - Just n -> return n ; - Nothing -> do - { mb_gre <- lookupGreLocalRn rdr_name - ; case mb_gre of - Just gre -> return (gre_name gre) - Nothing -> lookupGlobalOccRn rdr_name - }}} ----------------------------------------------- lookupInstDeclBndr :: Name -> Located RdrName -> RnM (Located Name)