Fix #15941 by only special-casing visible infix applications
authorRyan Scott <ryan.gl.scott@gmail.com>
Mon, 26 Nov 2018 17:59:50 +0000 (12:59 -0500)
committerRyan Scott <ryan.gl.scott@gmail.com>
Mon, 26 Nov 2018 18:56:34 +0000 (13:56 -0500)
commit984b75de7082689ebcc6e9d17b37f2c9b3702f71
tree013bb5fe4da1ba79d3cf646f1c2a0ce6d65a96d8
parent8f9f52d8e421ce544d5437a93117545d52d0eabd
Fix #15941 by only special-casing visible infix applications

Summary:
The iface pretty-printer had a special case for an
application of an infix type constructor to two arguments. But this
didn't take the visibilities of the arguments into account, which
could lead to strange output like `@{LiftedRep} -> @{LiftedRep}` when
`-fprint-explicit-kinds` was enabled (#15941). The fix is relatively
straightforward: simply plumb through the visibilities of each
argument, and only trigger the special case for infix applications
if both arguments are visible (i.e., required).

Test Plan: make test TEST=T15941

Reviewers: goldfire, bgamari, monoidal

Reviewed By: goldfire, monoidal

Subscribers: simonpj, rwbarton, carter

GHC Trac Issues: #15941

Differential Revision: https://phabricator.haskell.org/D5375
compiler/iface/IfaceType.hs
testsuite/tests/ghci/scripts/T15941.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/T15941.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/all.T