Fix a TyVar bug in the flattener
authorSimon Peyton Jones <simonpj@microsoft.com>
Tue, 14 Nov 2017 09:16:22 +0000 (09:16 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Tue, 14 Nov 2017 11:12:33 +0000 (11:12 +0000)
commit0a85190312a1de3d300912051309b94589c08683
tree12dfdeb728e0782adad5c05980d858669ad01e3e
parente3ec2e7ae94524ebd111963faf34b84d942265b4
Fix a TyVar bug in the flattener

A year ago I gave up on trying to rigorously separate TyVars
from TcTyVars, and instead allowed TyVars to appear rather more
freely in types examined by the constraint solver:

   commit 18d0bdd3848201882bae167e3b15fd797d217e93
   Author: Simon Peyton Jones <simonpj@microsoft.com>
   Date:   Wed Nov 23 16:00:00 2016 +0000

   Allow TyVars in TcTypes

See Note [TcTyVars in the typechecker] in TcType.

However, TcFlatten.flatten_tyvar1 turned out to treat
a TyVar specially, and implicitly assumed that it could
not have an equality constraint in the inert set.  Wrong!

This caused Trac #14450.  Fortunately it is easily fixed,
by deleting code.
compiler/typecheck/TcFlatten.hs
compiler/typecheck/TcType.hs
compiler/typecheck/TcUnify.hs
testsuite/tests/polykinds/T14450.hs [new file with mode: 0644]
testsuite/tests/polykinds/T14450.stderr [new file with mode: 0644]
testsuite/tests/polykinds/all.T