= addErrCtxt (exprCtxt in_expr) $
tcHsSigType ExprSigCtxt poly_ty `thenM` \ sig_tc_ty ->
tcThingWithSig sig_tc_ty (tcCheckRho expr) res_ty `thenM` \ (co_fn, expr') ->
- returnM (co_fn <$> unLoc expr')
- -- ToDo: nasty unLoc
+ returnM (co_fn <$> ExprWithTySigOut expr' poly_ty)
tc_expr (HsType ty) res_ty
= failWithTc (text "Can't handle type argument:" <+> ppr ty)
-- the type of dataConWrapId (see note on "stupid context" in DataCon.lhs
-- It's dual to TcPat.tcConstructor
inst_data_con data_con
- = tcInstDataCon orig data_con `thenM` \ (ty_args, ex_dicts, arg_tys, result_ty, _) ->
- extendLIEs ex_dicts `thenM_`
- getSrcSpanM `thenM` \ loc ->
+ = tcInstDataCon orig VanillaTv data_con `thenM` \ (ty_args, ex_dicts, arg_tys, result_ty, _) ->
+ extendLIEs ex_dicts `thenM_`
+ getSrcSpanM `thenM` \ loc ->
returnM (unLoc (mkHsDictApp (mkHsTyApp (L loc (HsVar (dataConWrapId data_con))) ty_args)
(map instToId ex_dicts)),
mkFunTys arg_tys result_ty)