X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcExpr.lhs;h=39e8a5c959a0689a9db7fa1214ca92e9aa85a9ca;hb=f750bec77c4f1b6d986dfa237df63a70689e9849;hp=14a1d6d390aac606e6e5122917804958212847a2;hpb=ff8e1d01524b48e028b09e2b04b2e5303cb6d95f;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcExpr.lhs b/compiler/typecheck/TcExpr.lhs index 14a1d6d..39e8a5c 100644 --- a/compiler/typecheck/TcExpr.lhs +++ b/compiler/typecheck/TcExpr.lhs @@ -29,6 +29,7 @@ import TcHsType import TcPat import TcMType import TcType +import TcIface ( checkWiredInTyCon ) import Id import DataCon import Name @@ -302,10 +303,11 @@ tcExpr (ExplicitTuple exprs boxity) res_ty = do { tvs <- newBoxyTyVars [argTypeKind | e <- exprs] ; let tup_tc = tupleTyCon boxity (length exprs) tup_res_ty = mkTyConApp tup_tc (mkTyVarTys tvs) - ; arg_tys <- preSubType tvs (mkVarSet tvs) tup_res_ty res_ty - ; exprs' <- tcPolyExprs exprs arg_tys + ; checkWiredInTyCon tup_tc -- Ensure instances are available + ; arg_tys <- preSubType tvs (mkVarSet tvs) tup_res_ty res_ty + ; exprs' <- tcPolyExprs exprs arg_tys ; arg_tys' <- mapM refineBox arg_tys - ; co_fn <- tcFunResTy (tyConName tup_tc) (mkTyConApp tup_tc arg_tys') res_ty + ; co_fn <- tcFunResTy (tyConName tup_tc) (mkTyConApp tup_tc arg_tys') res_ty ; return (mkHsWrap co_fn (ExplicitTuple exprs' boxity)) } tcExpr (HsProc pat cmd) res_ty @@ -484,7 +486,6 @@ tcExpr expr@(RecordUpd record_expr hrbinds@(HsRecordBinds rbinds) _ _ _) res_ty = WpCo $ mkTyConApp co_con scrut_inst_tys | otherwise = idHsWrapper - scrut_ty = mkTyConApp tycon scrut_inst_tys -- Type of pattern, the result of the cast in -- Phew! returnM (mkHsWrap co_fn (RecordUpd (mkLHsWrap scrut_co record_expr') rbinds'