X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypecheck%2FInst.lhs;h=c009ebe0831f496d8265086255f61803ece626c1;hp=1a8efe2ebf0c54a3a86500593166b520c0f710ab;hb=a187566d4ce21b657fd5268373d0e3743d29d886;hpb=c93a92a5950a6343d93774cb07530deb8dd4ac3d diff --git a/compiler/typecheck/Inst.lhs b/compiler/typecheck/Inst.lhs index 1a8efe2..c009ebe 100644 --- a/compiler/typecheck/Inst.lhs +++ b/compiler/typecheck/Inst.lhs @@ -45,7 +45,8 @@ module Inst ( mkIdEqInstCo, mkSymEqInstCo, mkLeftTransEqInstCo, mkRightTransEqInstCo, mkAppEqInstCo, isValidWantedEqInst, - eitherEqInst, mkEqInst, mkEqInsts, mkWantedEqInst, finalizeEqInst, + eitherEqInst, mkEqInst, mkEqInsts, mkWantedEqInst, + wantedToLocalEqInst, finalizeEqInst, eqInstType, updateEqInstCoercion, eqInstCoercion, eqInstTys ) where @@ -1095,6 +1096,15 @@ mkWantedEqInst pred@(EqPred ty1 ty2) } mkWantedEqInst pred = pprPanic "mkWantedEqInst" (ppr pred) +-- Turn a wanted equality into a local that propagates the uninstantiated +-- coercion variable as witness. We need this to propagate wanted irreds into +-- attempts to solve implication constraints. +-- +wantedToLocalEqInst :: Inst -> Inst +wantedToLocalEqInst eq@(EqInst {tci_co = Left cotv}) + = eq {tci_co = Right (mkTyVarTy cotv)} +wantedToLocalEqInst eq = eq + -- Turn a wanted into a local EqInst (needed during type inference for -- signatures) --