Robustify lookupFamInstEnv
authorsimonpj@microsoft.com <unknown>
Wed, 14 Jan 2009 14:01:17 +0000 (14:01 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 14 Jan 2009 14:01:17 +0000 (14:01 +0000)
commit27759873a8bd45c487a6e636f7a12c37e87f616f
tree497302ff6209e8ebdc09b59e144511e3acf177e2
parente3cb60d26917d7be1b34030b1e5a579fbef9d067
Robustify lookupFamInstEnv

Suppose we have
        type family T a :: * -> *
        type instance T Int = []

and now we encounter the type (T Int Bool).  That is perfectly
fine, even though T is over-saturated here.

This patch makes lookupFamInstEnv robust to such over-saturation.
Previously one caller (TcTyFuns.tcUnfoldSynFamInst) dealt with
the over-saturation case, but the others did not. It's better
to desl with the issue at the root, in lookupFamInstEnv itself.
compiler/typecheck/TcTyFuns.lhs
compiler/types/FamInstEnv.lhs