Commit 5e4375ad authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Make another parse error more informative

parent 4186a2d5
......@@ -362,7 +362,7 @@ splitCon ty
split (L _ (HsAppTy t u)) ts = split t (u : ts)
split (L l (HsTyVar tc)) ts = do data_con <- tyConToDataCon l tc
return (data_con, mk_rest ts)
split (L l _) _ = parseError l "parse error in data/newtype declaration"
split (L l _) _ = parseErrorSDoc l (text "parse error in constructor in data/newtype declaration:" <+> ppr ty)
mk_rest [L _ (HsRecTy flds)] = RecCon flds
mk_rest ts = PrefixCon ts
Supports Markdown
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