From: sof Date: Fri, 7 May 1999 13:41:14 +0000 (+0000) Subject: [project @ 1999-05-07 13:41:14 by sof] X-Git-Tag: Approximately_9120_patches~6246 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=bbc652466faf9f4809d7aaf840be5be861fcd49f;p=ghc-hetmet.git [project @ 1999-05-07 13:41:14 by sof] Fixed two showstopping bugs in 'deriving Read' code (mea culpa). --- diff --git a/ghc/compiler/typecheck/TcGenDeriv.lhs b/ghc/compiler/typecheck/TcGenDeriv.lhs index e017cf2..bb27993 100644 --- a/ghc/compiler/typecheck/TcGenDeriv.lhs +++ b/ghc/compiler/typecheck/TcGenDeriv.lhs @@ -840,7 +840,7 @@ gen_Read_binds fixities tycon ]) | lab_fields == 0 = -- common case. snd (mapAccumL mk_qual - c_Expr + d_Expr (zipWithEqual "as_needed" (\ con_field draw_from -> (mk_read_qual 10 con_field, draw_from)) @@ -891,8 +891,9 @@ gen_Read_binds fixities tycon | not is_infix = 9 | otherwise = getFixity fixities dc_nm - read_paren_arg = -- parens depend on precedence... - HsPar (genOpApp a_Expr gt_RDR (HsLit (HsInt paren_prec_limit))) + read_paren_arg -- parens depend on precedence... + | nullary_con = false_Expr -- it's optional. + | otherwise = HsPar (genOpApp a_Expr gt_RDR (HsLit (HsInt paren_prec_limit))) \end{code}