-mkConErrMsg e sty
- = ($$) (ptext SLIT("Application of newtype constructor:"))
- (ppr sty e)
-
-mkCoerceErrMsg e sty
- = ($$) (ptext SLIT("Coercion using a datatype constructor:"))
- (ppr sty e)
-
-
-mkCaseAltMsg :: CoreCaseAlts -> ErrMsg
-mkCaseAltMsg alts sty
- = ($$) (ptext SLIT("Type of case alternatives not the same:"))
- (ppr sty alts)
-
-mkCaseDataConMsg :: CoreExpr -> ErrMsg
-mkCaseDataConMsg expr sty
- = ($$) (ptext SLIT("A case scrutinee not of data constructor type:"))
- (pp_expr sty expr)
-
-mkCaseNotPrimMsg :: TyCon -> ErrMsg
-mkCaseNotPrimMsg tycon sty
- = ($$) (ptext SLIT("A primitive case on a non-primitive type:"))
- (ppr sty tycon)
-
-mkCasePrimMsg :: TyCon -> ErrMsg
-mkCasePrimMsg tycon sty
- = ($$) (ptext SLIT("An algebraic case on a primitive type:"))
- (ppr sty tycon)
-
-mkCaseAbstractMsg :: TyCon -> ErrMsg
-mkCaseAbstractMsg tycon sty
- = ($$) (ptext SLIT("An algebraic case on some weird type:"))
- (ppr sty tycon)
-
-mkDefltMsg :: CoreCaseDefault -> ErrMsg
-mkDefltMsg deflt sty
- = ($$) (ptext SLIT("Binder in case default doesn't match type of scrutinee:"))
- (ppr sty deflt)
-
-mkAppMsg :: Type -> Type -> CoreExpr -> ErrMsg
-mkAppMsg fun arg expr sty
- = vcat [ptext SLIT("Argument value doesn't match argument type:"),
- hang (ptext SLIT("Fun type:")) 4 (ppr sty fun),
- hang (ptext SLIT("Arg type:")) 4 (ppr sty arg),
- hang (ptext SLIT("Expression:")) 4 (pp_expr sty expr)]
-
-mkTyAppMsg :: FAST_STRING -> Type -> Type -> CoreExpr -> ErrMsg
-mkTyAppMsg msg ty arg expr sty
- = vcat [hsep [ptext msg, ptext SLIT("type application:")],
- hang (ptext SLIT("Exp type:")) 4 (ppr sty ty),
- hang (ptext SLIT("Arg type:")) 4 (ppr sty arg),
- hang (ptext SLIT("Expression:")) 4 (pp_expr sty expr)]
-
-mkUsageAppMsg :: Type -> Usage -> CoreExpr -> ErrMsg
-mkUsageAppMsg ty u expr sty
- = vcat [ptext SLIT("Illegal usage application:"),
- hang (ptext SLIT("Exp type:")) 4 (ppr sty ty),
- hang (ptext SLIT("Usage exp:")) 4 (ppr sty u),
- hang (ptext SLIT("Expression:")) 4 (pp_expr sty expr)]
-
-mkAlgAltMsg1 :: Type -> ErrMsg
-mkAlgAltMsg1 ty sty
- = ($$) (text "In some case statement, type of scrutinee is not a data type:")
- (ppr sty ty)
--- (($$) (ppr sty ty) (ppr sty (expandTy ty))) -- ToDo: rm
-
-mkAlgAltMsg2 :: Type -> Id -> ErrMsg
-mkAlgAltMsg2 ty con sty
- = vcat [
- text "In some algebraic case alternative, constructor is not a constructor of scrutinee type:",
- ppr sty ty,
- ppr sty con
- ]