Commit 5a1ac8dc authored by simonpj's avatar simonpj
Browse files

[project @ 2001-11-26 10:33:40 by simonpj]

Complete previous tcAddImportedIdInfo commit
parent aa2901f9
...@@ -27,7 +27,7 @@ module TcEnv( ...@@ -27,7 +27,7 @@ module TcEnv(
tcGetGlobalTyVars, tcExtendGlobalTyVars, tcGetGlobalTyVars, tcExtendGlobalTyVars,
-- Random useful things -- Random useful things
RecTcEnv, tcAddImportedIdInfo, tcLookupRecId, tcLookupRecId_maybe, RecTcEnv, tcLookupRecId, tcLookupRecId_maybe,
-- New Ids -- New Ids
newLocalName, newDFunName, newLocalName, newDFunName,
...@@ -208,16 +208,6 @@ type RecTcEnv = TcEnv ...@@ -208,16 +208,6 @@ type RecTcEnv = TcEnv
-- on imported things and for looking up Ids in unfoldings -- on imported things and for looking up Ids in unfoldings
-- The environment doesn't have any local Ids in it -- The environment doesn't have any local Ids in it
tcAddImportedIdInfo :: RecTcEnv -> Id -> Id
tcAddImportedIdInfo env id
= id `lazySetIdInfo` new_info
-- The Id must be returned without a data dependency on maybe_id
where
new_info = case tcLookupRecId_maybe env (idName id) of
Nothing -> pprTrace "tcAddIdInfo" (ppr id) vanillaIdInfo
Just imported_id -> idInfo imported_id
-- ToDo: could check that types are the same
tcLookupRecId_maybe :: RecTcEnv -> Name -> Maybe Id tcLookupRecId_maybe :: RecTcEnv -> Name -> Maybe Id
tcLookupRecId_maybe env name = case lookup_global env name of tcLookupRecId_maybe env name = case lookup_global env name of
Just (AnId id) -> Just id Just (AnId id) -> Just id
......
...@@ -35,11 +35,9 @@ import Inst ( InstOrigin(..), ...@@ -35,11 +35,9 @@ import Inst ( InstOrigin(..),
LIE, mkLIE, emptyLIE, plusLIE, plusLIEs ) LIE, mkLIE, emptyLIE, plusLIE, plusLIEs )
import TcDeriv ( tcDeriving ) import TcDeriv ( tcDeriving )
import TcEnv ( TcEnv, tcExtendGlobalValEnv, import TcEnv ( TcEnv, tcExtendGlobalValEnv,
tcExtendTyVarEnvForMeths, tcLookupId, tcExtendTyVarEnvForMeths, tcLookupId, tcLookupClass,
tcAddImportedIdInfo, tcLookupClass,
InstInfo(..), pprInstInfo, simpleInstInfoTyCon, InstInfo(..), pprInstInfo, simpleInstInfoTyCon,
simpleInstInfoTy, newDFunName, simpleInstInfoTy, newDFunName
isLocalThing,
) )
import InstEnv ( InstEnv, extendInstEnv ) import InstEnv ( InstEnv, extendInstEnv )
import PprType ( pprClassPred ) import PprType ( pprClassPred )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment