summaryrefslogtreecommitdiff
path: root/compiler/iface
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2019-10-25 18:30:55 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-10-27 11:36:17 -0400
commitfa0d48094afb8025bd85356a5d62d2bc96eb2124 (patch)
tree8bcee1c7d0b959b9929ed425508b113624db16a7 /compiler/iface
parent7d80f8b5b529a63771d2f9771d5161825721f683 (diff)
downloadhaskell-fa0d48094afb8025bd85356a5d62d2bc96eb2124.tar.gz
Parenthesize nullary constraint tuples using sigPrec (#17403)
We were using `appPrec`, not `sigPrec`, as the precedence when determining whether or not to parenthesize `() :: Constraint`, which lead to the parentheses being omitted in function contexts like `(() :: Constraint) => String`. Easily fixed. Fixes #17403.
Diffstat (limited to 'compiler/iface')
-rw-r--r--compiler/iface/IfaceType.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/iface/IfaceType.hs b/compiler/iface/IfaceType.hs
index acf116169e..2ca9319b34 100644
--- a/compiler/iface/IfaceType.hs
+++ b/compiler/iface/IfaceType.hs
@@ -1467,7 +1467,7 @@ pprSum _arity is_promoted args
pprTuple :: PprPrec -> TupleSort -> PromotionFlag -> IfaceAppArgs -> SDoc
pprTuple ctxt_prec ConstraintTuple NotPromoted IA_Nil
- = maybeParen ctxt_prec appPrec $
+ = maybeParen ctxt_prec sigPrec $
text "() :: Constraint"
-- All promoted constructors have kind arguments