Fix TcType.anyRewritableTyVar
authorNingning Xie <xnningxie@gmail.com>
Sun, 28 Oct 2018 16:29:55 +0000 (12:29 -0400)
committerBen Gamari <ben@smart-cactus.org>
Sun, 28 Oct 2018 23:02:33 +0000 (19:02 -0400)
commitb391cae1c2b0d27425c2f0cd24d627e2742bfbed
tree69698bb3e140c7b740cca894a90ebca1b703278a
parent9f802777f958a6bc2152662d90edb6016b40a43d
Fix TcType.anyRewritableTyVar

Summary:
This patch fixes #15805, where we found that
`TcType.anyRewritableTyVar` has one wrong case.

Besides the fix, it also:
- removed some unnecessary `ASSERT2(tcIsTcTyVar...)` in `TcType`, as now we have
     `tcIsTcTyVar = isTyVar`.
- fixed some comments

Test Plan: ./validate

Reviewers: goldfire, simonpj, bgamari

Reviewed By: simonpj

Subscribers: rwbarton, carter

GHC Trac Issues: #15805

Differential Revision: https://phabricator.haskell.org/D5263

(cherry picked from commit a7f64c6cbfc5562adff207945576d1c9db2a58d9)
compiler/typecheck/TcType.hs