Fix #16391 by using occCheckExpand in TcValidity
authorRyan Scott <ryan.gl.scott@gmail.com>
Wed, 6 Mar 2019 19:42:02 +0000 (14:42 -0500)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Thu, 7 Mar 2019 19:07:49 +0000 (14:07 -0500)
commit068b7e983f4a0b35f453aa5e609998efd0c3f334
tree7a0372414b520722b1168fa9b5e15afcdb821caf
parent7a68254a7284db5bf8f1fa82aba4a6825d8f050a
Fix #16391 by using occCheckExpand in TcValidity

The type-variables-escaping-their-scope-via-kinds check in
`TcValidity` was failing to properly expand type synonyms, which led
to #16391. This is easily fixed by using `occCheckExpand` before
performing the validity check.

Along the way, I refactored this check out into its own function,
and sprinkled references to Notes to better explain all of the moving
parts. Many thanks to @simonpj for the suggestions.

Bumps the haddock submodule.
12 files changed:
compiler/basicTypes/OccName.hs
compiler/typecheck/TcValidity.hs
compiler/types/TyCoRep.hs
compiler/types/Type.hs
testsuite/tests/dependent/should_compile/T16391a.hs [new file with mode: 0644]
testsuite/tests/dependent/should_compile/all.T
testsuite/tests/dependent/should_fail/T16391b.hs [new file with mode: 0644]
testsuite/tests/dependent/should_fail/T16391b.stderr [new file with mode: 0644]
testsuite/tests/dependent/should_fail/all.T
testsuite/tests/ghci/scripts/T11524a.stdout
testsuite/tests/patsyn/should_compile/T11213.stderr
utils/haddock