From fad3991be5c706bd094980fc0c6588162d7bf797 Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 22 Jun 2000 14:41:29 +0000 Subject: [PATCH] [project @ 2000-06-22 14:41:29 by simonpj] *** MERGE WITH 4.07 *** * ParseIface.y should reject newtypes with no definition: newtype T a ; The rest of the compiler falls over if it sees such a thing. --- ghc/compiler/rename/ParseIface.y | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ghc/compiler/rename/ParseIface.y b/ghc/compiler/rename/ParseIface.y index cf0bf83..e91ee02 100644 --- a/ghc/compiler/rename/ParseIface.y +++ b/ghc/compiler/rename/ParseIface.y @@ -468,9 +468,8 @@ constr : src_loc ex_stuff data_name batypes { mk_con_decl $3 $2 (VanillaCon $ | src_loc ex_stuff data_name '{' fields1 '}' { mk_con_decl $3 $2 (RecCon $5) $1 } -- We use "data_fs" so as to include () -newtype_constr :: { [RdrNameConDecl] {- Empty if handwritten abstract -} } -newtype_constr : { [] } - | src_loc '=' ex_stuff data_name atype { [mk_con_decl $4 $3 (NewCon $5 Nothing) $1] } +newtype_constr :: { [RdrNameConDecl] {- Not allowed to be empty -} } +newtype_constr : src_loc '=' ex_stuff data_name atype { [mk_con_decl $4 $3 (NewCon $5 Nothing) $1] } | src_loc '=' ex_stuff data_name '{' var_name '::' atype '}' { [mk_con_decl $4 $3 (NewCon $8 (Just $6)) $1] } -- 1.7.10.4