IMP_Ubiq()
import Type
+import CmdLineOpts ( opt_PprUserLength )
import CoreSyn
import Literal
import CoreUnfold ( mkUnfolding, PragmaInfo(..) )
dataConStrictMarks, dataConFieldLabels, dataConArgTys,
recordSelectorFieldLabel, dataConSig,
StrictnessMark(..),
- isDataCon, isMethodSelId_maybe, isSuperDictSelId_maybe,
+ isAlgCon, isMethodSelId_maybe, isSuperDictSelId_maybe,
isRecordSelector, isPrimitiveId_maybe,
addIdUnfolding, addIdArity,
SYN_IE(Id)
)
import IdInfo ( ArityInfo, exactArity )
import Class ( GenClass, GenClassOp, classSig, classOpLocalType )
-import TyCon ( isNewTyCon )
+import TyCon ( isNewTyCon, isDataTyCon, isAlgTyCon )
import FieldLabel ( FieldLabel )
import PrelVals ( pAT_ERROR_ID )
import Maybes
-import PprStyle ( PprStyle(..) )
+import Outputable ( PprStyle(..), Outputable(..) )
import Pretty
import Util ( assertPanic, pprTrace,
assoc
)
-#if __GLASGOW_HASKELL__ >= 202
-import Outputable
-#endif
\end{code}
addStandardIdInfo con_id
- | isDataCon con_id
+ | isAlgCon con_id
= con_id `addIdUnfolding` unfolding
`addIdArity` exactArity (length locals)
where
\begin{code}
addStandardIdInfo sel_id
| isRecordSelector sel_id
- = ASSERT( null theta )
+ = ASSERT( null theta && isDataTyCon tycon )
sel_id `addIdUnfolding` unfolding
`addIdArity` exactArity 1
-- ToDo: consider adding further IdInfo
maybe_the_arg_id = assocMaybe (field_lbls `zip` arg_ids) field_lbl
error_expr = mkApp (Var pAT_ERROR_ID) [] [rhs_ty] [LitArg msg_lit]
- full_msg = show (sep [text "No match in record selector", ppr PprForUser sel_id])
+ full_msg = show (sep [text "No match in record selector", ppr (PprForUser opt_PprUserLength) sel_id])
msg_lit = NoRepStr (_PK_ full_msg)
\end{code}