import Name ( Name {-instance NamedThing-}, nameOccName,
nameModule, isLocallyDefined,
- isWiredInName, nameUnique, NamedThing(..),
+ isWiredInName, NamedThing(..),
elemNameEnv, extendNameEnv
)
-import Module ( Module, moduleString, pprModule,
- mkVanillaModule, pprModuleName,
- moduleUserString, moduleName, isLocalModule,
+import Module ( Module, mkVanillaModule, pprModuleName,
+ moduleName, isLocalModule,
ModuleName, WhereFrom(..),
)
import RdrName ( RdrName, rdrNameOcc )
import NameSet
import SrcLoc ( mkSrcLoc, SrcLoc )
import PrelInfo ( cCallishTyKeys )
-import Maybes ( MaybeErr(..), maybeToBool, orElse )
+import Maybes ( maybeToBool )
import Unique ( Uniquable(..) )
import StringBuffer ( hGetStringBuffer )
import FastString ( mkFastString )
loadHomeInterface doc_str needed_name `thenRn` \ ifaces ->
case lookupNameEnv (iDecls ifaces) needed_name of
- Just (version, avail, is_tycon_name, decl@(_, TyClD (TyData DataType _ _ _ _ ncons _ _ _)))
+ Just (version, avail, is_tycon_name, decl@(_, TyClD (TyData DataType _ _ _ _ ncons _ _ _ _ _)))
-- This case deals with deferred import of algebraic data types
| not opt_NoPruneTyDecls
export_info = [(m, sortExport as) | (m,as) <- fmToList export_fm]
in
+ traceRn (text "Modules in Ifaces: " <+> fsep (map ppr (keysFM mod_map))) `thenRn_`
returnRn (export_info, import_info)
-> RdrNameHsDecl
-> RnM d (Maybe AvailInfo)
-getDeclBinders new_name (TyClD (TyData _ _ tycon _ condecls _ _ _ src_loc))
+getDeclBinders new_name (TyClD (TyData _ _ tycon _ condecls _ _ _ src_loc _ _))
= new_name tycon src_loc `thenRn` \ tycon_name ->
getConFieldNames new_name condecls `thenRn` \ sub_names ->
returnRn (Just (AvailTC tycon_name (tycon_name : nub sub_names)))
= new_name tycon src_loc `thenRn` \ tycon_name ->
returnRn (Just (AvailTC tycon_name [tycon_name]))
-getDeclBinders new_name (TyClD (ClassDecl _ cname _ _ sigs _ _ _ _ _ _ src_loc))
+getDeclBinders new_name (TyClD (ClassDecl _ cname _ _ sigs _ _ _ src_loc))
= new_name cname src_loc `thenRn` \ class_name ->
-- Record the names for the class ops
bindings of their own elsewhere.
\begin{code}
-getDeclSysBinders new_name (TyClD (ClassDecl _ cname _ _ sigs _ _ tname dname dwname snames src_loc))
- = sequenceRn [new_name n src_loc | n <- (tname : dname : dwname : snames)]
+getDeclSysBinders new_name (TyClD (ClassDecl _ cname _ _ sigs _ _ names
+ src_loc))
+ = sequenceRn [new_name n src_loc | n <- names]
-getDeclSysBinders new_name (TyClD (TyData _ _ _ _ cons _ _ _ _))
+getDeclSysBinders new_name (TyClD (TyData _ _ _ _ cons _ _ _ _ _ _))
= sequenceRn [new_name wkr_name src_loc | ConDecl _ wkr_name _ _ _ src_loc <- cons]
getDeclSysBinders new_name other_decl
-- one for 'normal' ones, the other for .hi-boot files,
-- hence the need to signal which kind we're interested.
- getHiMaps `thenRn` \ (search_path, hi_map, hiboot_map) ->
+ --getHiMaps `thenRn` \ (search_path, hi_map, hiboot_map) ->
let
- relevant_map | hi_boot_file = hiboot_map
- | otherwise = hi_map
+ bomb = panic "findAndReadInterface: hi_maps: FIXME"
+ search_path = panic "findAndReadInterface: search_path: FIXME"
+ relevant_map | hi_boot_file = bomb --hiboot_map
+ | otherwise = bomb --hi_map
in
case lookupFM relevant_map mod_name of
-- Found the file
ptext SLIT("from module") <+> quotes (ppr (nameModule name))
]
-getDeclWarn name loc
- = sep [ptext SLIT("Failed to find (optional) interface decl for") <+> quotes (ppr name),
- ptext SLIT("desired at") <+> ppr loc]
-
importDeclWarn name
= sep [ptext SLIT(
"Compiler tried to import decl from interface file with same name as module."),