X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fiface%2FTcIface.lhs;h=42dd3a8ac24c6db9854cc52fc590a1774fb2dad2;hb=d7b36bbbcd56ee14656223d02e32f5a1f52ea17b;hp=32735a4e3621f10a7abe74ed6237370aff1a678f;hpb=1fa3580c54985d73178d1d396b897176a57cd7f3;p=ghc-hetmet.git diff --git a/compiler/iface/TcIface.lhs b/compiler/iface/TcIface.lhs index 32735a4..42dd3a8 100644 --- a/compiler/iface/TcIface.lhs +++ b/compiler/iface/TcIface.lhs @@ -127,7 +127,8 @@ checkWiredInTyCon tc = return () | otherwise = do { mod <- getModule - ; unless (mod == nameModule tc_name) + ; ASSERT( isExternalName tc_name ) + unless (mod == nameModule tc_name) (initIfaceTcRn (loadWiredInHomeIface tc_name)) -- Don't look for (non-existent) Float.hi when -- compiling Float.lhs, which mentions Float of course @@ -144,7 +145,8 @@ importDecl name do { traceIf nd_doc -- Load the interface, which should populate the PTE - ; mb_iface <- loadInterface nd_doc (nameModule name) ImportBySystem + ; mb_iface <- ASSERT2( isExternalName name, ppr name ) + loadInterface nd_doc (nameModule name) ImportBySystem ; case mb_iface of { Failed err_msg -> return (Failed err_msg) ; Succeeded _ -> do @@ -492,11 +494,15 @@ tcIfaceDataCons tycon_name tycon _ if_cons ; arg_tys <- forkM (mk_doc name) (mapM tcIfaceType args) ; lbl_names <- mapM lookupIfaceTop field_lbls + -- Remember, tycon is the representation tycon + ; let orig_res_ty = mkFamilyTyConApp tycon + (substTyVars (mkTopTvSubst eq_spec) univ_tyvars) + ; buildDataCon name is_infix {- Not infix -} stricts lbl_names univ_tyvars ex_tyvars eq_spec theta - arg_tys tycon + arg_tys orig_res_ty tycon } mk_doc con_name = ptext (sLit "Constructor") <+> ppr con_name @@ -1047,7 +1053,8 @@ ifCheckWiredInThing name -- we may typecheck GHC.Base.hi. At that point, GHC.Base is not in -- the HPT, so without the test we'll demand-load it into the PIT! -- C.f. the same test in checkWiredInTyCon above - ; unless (mod == nameModule name) + ; ASSERT2( isExternalName name, ppr name ) + unless (mod == nameModule name) (loadWiredInHomeIface name) } tcIfaceTyCon :: IfaceTyCon -> IfL TyCon