Fix unparseable pretty-printing of promoted data cons
authorAndreas Herrmann <andreash87@gmx.ch>
Thu, 7 Jun 2018 17:24:52 +0000 (13:24 -0400)
committerBen Gamari <ben@smart-cactus.org>
Thu, 7 Jun 2018 22:06:29 +0000 (18:06 -0400)
commit767536ccf95d8352d146b6544857b28d9c42937e
treec0d3f6d4d6b6977ed9835c9e5617aba746765d57
parente7678d6a0607013749e9ba4d88df949ad1192765
Fix unparseable pretty-printing of promoted data cons

Previously we would print code which would not round-trip:
```
> :set -XDataKinds
> :set -XPolyKinds
> data Proxy k = Proxy
> _ :: Proxy '[ 'True ]
error:
  Found hole: _ :: Proxy '['True]
> _ :: Proxy '['True]
error:
    Invalid type signature: _ :: ...
    Should be of form <variable> :: <type>
```

Test Plan: Validate with T14343

Reviewers: RyanGlScott, goldfire, bgamari, tdammers

Reviewed By: RyanGlScott, bgamari

Subscribers: tdammers, rwbarton, thomie, carter

GHC Trac Issues: #14343

Differential Revision: https://phabricator.haskell.org/D4746
compiler/iface/IfaceType.hs
testsuite/tests/perf/compiler/T13035.stderr
testsuite/tests/perf/compiler/T9872b.stderr
testsuite/tests/printer/Makefile
testsuite/tests/printer/T14343.hs [new file with mode: 0644]
testsuite/tests/printer/T14343.stderr [new file with mode: 0644]
testsuite/tests/printer/T14343b.hs [new file with mode: 0644]
testsuite/tests/printer/T14343b.stderr [new file with mode: 0644]
testsuite/tests/printer/all.T
testsuite/tests/typecheck/should_fail/T15067.stderr
testsuite/tests/unboxedsums/T12711.stdout