Typechecking of explicit tuples is done "by hand" (rather than using
boxySplitTyConApp) so that rigidity is maintained. In making that change
I'd forgotten to retain the call to checkWiredInTyCon, which is important
to make sure instances are brought into scope.
Test is tc227.
import TcPat
import TcMType
import TcType
import TcPat
import TcMType
import TcType
+import TcIface ( checkWiredInTyCon )
import Id
import DataCon
import Name
import Id
import DataCon
import Name
= do { tvs <- newBoxyTyVars [argTypeKind | e <- exprs]
; let tup_tc = tupleTyCon boxity (length exprs)
tup_res_ty = mkTyConApp tup_tc (mkTyVarTys tvs)
= 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
; 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
; return (mkHsWrap co_fn (ExplicitTuple exprs' boxity)) }
tcExpr (HsProc pat cmd) res_ty