X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2Ftypecheck%2FTcTyFuns.lhs;h=c91ac63e19b917770fdad042cdcbb1c0c27fa531;hb=03b468c46b2a12a51400a6d5f5aa37524b5b998b;hp=0130aa6c4ebd984cff9d64ebfb7e48f10a2179ea;hpb=421819753b3eb4940a26e578ef0e4c5cd31761fa;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcTyFuns.lhs b/compiler/typecheck/TcTyFuns.lhs index 0130aa6..c91ac63 100644 --- a/compiler/typecheck/TcTyFuns.lhs +++ b/compiler/typecheck/TcTyFuns.lhs @@ -526,7 +526,12 @@ swapInst i@(EqInst {}) -- we should swap! go ty1 ty2@(TyConApp tyCon _) | isOpenSynTyCon tyCon - = do { wg_co <- eitherEqInst i + = actual_swap ty1 ty2 + go ty1@(TyConApp _ _) ty2@(TyVarTy _) + = actual_swap ty1 ty2 + go _ _ = return (i,False) + + actual_swap ty1 ty2 = do { wg_co <- eitherEqInst i -- old_co := sym new_co (\old_covar -> do { new_cotv <- newMetaTyVar TauTv (mkCoKind ty2 ty1) @@ -539,7 +544,6 @@ swapInst i@(EqInst {}) ; new_inst <- mkEqInst (EqPred ty2 ty1) wg_co ; return (new_inst,True) } - go _ _ = return (i,False) -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ decompInsts :: [Inst] -> TcM ([Inst],Bool)