Commit 55db5c32 authored by sof's avatar sof
Browse files

[project @ 1999-03-24 18:21:21 by sof]

In case the desugaring of a lit-lit should fail, give a more informative error msg
parent e7a80ef9
......@@ -184,7 +184,19 @@ dsExpr (HsLitOut (HsString str) _)
= returnDs (mkLit (NoRepStr str stringTy))
dsExpr (HsLitOut (HsLitLit str) ty)
= returnDs ( mkConApp data_con [mkLit (MachLitLit str prim_ty)] )
= case (maybeBoxedPrimType ty) of
Just (boxing_data_con, prim_ty) ->
returnDs ( mkConApp boxing_data_con [mkLit (MachLitLit str prim_ty)] )
_ ->
pprError "ERROR:"
(vcat
[ hcat [ text "Cannot see data constructor of ``literal-literal''s type: "
, text "value:", quotes (quotes (ptext str))
, text "; type: ", ppr ty
]
, text "Try compiling with -fno-prune-tydecls."
])
where
(data_con, prim_ty)
= case (maybeBoxedPrimType ty) of
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment