summaryrefslogtreecommitdiff
path: root/compiler/hsSyn
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-08-28 13:36:17 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2012-08-28 13:36:17 +0100
commit7dfbed230ceab5b25cc75a0c42bfc94aa918a1bf (patch)
treebeaa9e96d99a426d22e7ce19ed91d3c97ab026b3 /compiler/hsSyn
parentab2fe55573499d5fa3d993a018206a02b91d651a (diff)
downloadhaskell-7dfbed230ceab5b25cc75a0c42bfc94aa918a1bf.tar.gz
Fix pretty-printing for GADTs in infix form
Diffstat (limited to 'compiler/hsSyn')
-rw-r--r--compiler/hsSyn/HsDecls.lhs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/hsSyn/HsDecls.lhs b/compiler/hsSyn/HsDecls.lhs
index bac9ec6348..cd19e4c89b 100644
--- a/compiler/hsSyn/HsDecls.lhs
+++ b/compiler/hsSyn/HsDecls.lhs
@@ -800,9 +800,10 @@ pprConDecl (ConDecl { con_name = con, con_explicit = expl, con_qvars = tvs
= sep [ppr con <+> dcolon <+> pprHsForAll expl tvs cxt,
pprConDeclFields fields <+> arrow <+> ppr res_ty]
-pprConDecl (ConDecl {con_name = con, con_details = InfixCon {}, con_res = ResTyGADT {} })
- = pprPanic "pprConDecl" (ppr con)
+pprConDecl decl@(ConDecl { con_details = InfixCon ty1 ty2, con_res = ResTyGADT {} })
+ = pprConDecl (decl { con_details = PrefixCon [ty1,ty2] })
-- In GADT syntax we don't allow infix constructors
+ -- but the renamer puts them in this form (Note [Infix GADT constructors] in RnSource)
\end{code}
%************************************************************************