X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcTyFuns.lhs;h=126a02961e2b178017d9a0546afb8a710a0832c8;hb=2eeaaa6f9eb206ad3473c151556629a2e2624f78;hp=64c983034614e573d3093779851fe1b7c8c3ff79;hpb=6d2b0ae3ae3296cb6cdd496cbf85b897c7ce150b;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcTyFuns.lhs b/compiler/typecheck/TcTyFuns.lhs index 64c9830..126a029 100644 --- a/compiler/typecheck/TcTyFuns.lhs +++ b/compiler/typecheck/TcTyFuns.lhs @@ -953,10 +953,14 @@ unifyMetaRule insts -- updatable meta variable meets non-variable type -- => occurs check, monotype check, and kinds match check, then update uMeta swapped tv (DoneTv (MetaTv _ ref)) ty cotv - = do { ty' <- checkTauTvUpdate tv ty -- occurs + monotype check - ; checkUpdateMeta swapped tv ref ty' -- update meta var - ; writeMetaTyVar cotv ty' -- update the co var - ; return ([], True) + = do { mb_ty' <- checkTauTvUpdate tv ty -- occurs + monotype check + ; case mb_ty' of + Nothing -> return ([inst], False) -- tv occurs in faminst + Just ty' -> + do { checkUpdateMeta swapped tv ref ty' -- update meta var + ; writeMetaTyVar cotv ty' -- update co var + ; return ([], True) + } } uMeta _ _ _ _ _ = panic "uMeta"