-- So WATCH OUT; check each use of split*Ty functions.
-- Sigh. This is a pain.
-import TcType ( tcSplitAppTy, tcSplitFunTys, tcSplitTyConApp_maybe, tcTyConAppArgs,
+import TcType ( tcSplitAppTy, tcSplitFunTys, tcTyConAppArgs,
isIntegerTy, tcSplitTyConApp, isUnLiftedType, Type )
import Type ( splitFunTys )
import CoreSyn
import DataCon ( isExistentialDataCon )
import Literal ( Literal(..) )
import TyCon ( tyConDataCons )
-import TysWiredIn ( tupleCon, listTyCon, charDataCon, intDataCon )
+import TysWiredIn ( tupleCon, charDataCon, intDataCon )
import BasicTypes ( RecFlag(..), Boxity(..), ipNameName )
import Maybes ( maybeToBool )
import PrelNames ( hasKey, ratioTyConKey, toPName )
dsExpr (RecordUpdOut record_expr record_in_ty record_out_ty dicts [])
= dsExpr record_expr
-dsExpr (RecordUpdOut record_expr record_in_ty record_out_ty dicts rbinds)
+dsExpr expr@(RecordUpdOut record_expr record_in_ty record_out_ty dicts rbinds)
= getSrcLocDs `thenDs` \ src_loc ->
dsExpr record_expr `thenDs` \ record_expr' ->
src_loc)
in
-- Record stuff doesn't work for existentials
- ASSERT( all (not . isExistentialDataCon) data_cons )
+ -- The type checker checks for this, but we need
+ -- worry only about the constructors that are to be updated
+ ASSERT2( all (not . isExistentialDataCon) cons_to_upd, ppr expr )
-- It's important to generate the match with matchWrapper,
-- and the right hand sides with applications of the wrapper Id