From bbc652466faf9f4809d7aaf840be5be861fcd49f Mon Sep 17 00:00:00 2001 From: sof Date: Fri, 7 May 1999 13:41:14 +0000 Subject: [PATCH] [project @ 1999-05-07 13:41:14 by sof] Fixed two showstopping bugs in 'deriving Read' code (mea culpa). --- ghc/compiler/typecheck/TcGenDeriv.lhs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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} -- 1.7.10.4