Rejig rejigConRes & friends, doing role checks in a second pass.
authorRichard Eisenberg <eir@cis.upenn.edu>
Sat, 30 Nov 2013 21:05:47 +0000 (16:05 -0500)
committerRichard Eisenberg <eir@cis.upenn.edu>
Mon, 2 Dec 2013 16:42:16 +0000 (11:42 -0500)
commit406734066ea536b5d11373335edb8c24d0aa0834
treed06c8a042084d9955dd8fea574b5e6622ea86803
parent3fecf81ee414799847d43f9aa71d830b87facaa6
Rejig rejigConRes & friends, doing role checks in a second pass.

This commit is just a refactoring, intended to make the use of
rejigConRes (which sorts out the return types of GADT-like constructors)
less delicate. The idea is that, if we perform role checking in a
second top-level pass, we can use checkValidDataCon to check for
valid return types. Previously, checking roles would force the
rejigConRes thunk before we knew that rejigConRes was safe to call!
compiler/typecheck/TcEvidence.lhs
compiler/typecheck/TcInstDcls.lhs
compiler/typecheck/TcTyClsDecls.lhs
compiler/typecheck/TcTyDecls.lhs