X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fiface%2FTcIface.lhs;h=39eadfb681b61453db59be4dc4970b66f2d2b797;hb=9d458d01d2a75b1e452ba00c4e76f3c3d0bc5ba6;hp=8c45b6922020e21eab07c57a37b306c29e673964;hpb=550421384b8364cdaf3135f7859c9f7d7ee1fff1;p=ghc-hetmet.git diff --git a/ghc/compiler/iface/TcIface.lhs b/ghc/compiler/iface/TcIface.lhs index 8c45b69..39eadfb 100644 --- a/ghc/compiler/iface/TcIface.lhs +++ b/ghc/compiler/iface/TcIface.lhs @@ -529,8 +529,9 @@ selectInsts pool@(Pool insts n_in n_out) cls tycons -- Reverses the gated decls, but that doesn't matter choose2 (gis, decls) (gates, decl) - | any (`elem` tycons) gates = (gis, decl:decls) - | otherwise = ((gates,decl) : gis, decls) + | null gates -- Happens when we have 'instance T a where ...' + || any (`elem` tycons) gates = (gis, decl:decls) + | otherwise = ((gates,decl) : gis, decls) \end{code} %************************************************************************ @@ -586,7 +587,7 @@ selectRules (Pool rules n_in n_out) type_env | null gates' = (pool, rule:if_rules) | otherwise = ((gates',rule) : pool, if_rules) where - gates' = filter (`elemNameEnv` type_env) gates + gates' = filter (not . (`elemNameEnv` type_env)) gates tcIfaceRule :: IfaceRule -> IfL IdCoreRule