From: simonpj Date: Wed, 17 Dec 2003 11:43:13 +0000 (+0000) Subject: [project @ 2003-12-17 11:43:13 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~183 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=9d458d01d2a75b1e452ba00c4e76f3c3d0bc5ba6 [project @ 2003-12-17 11:43:13 by simonpj] --------------------------------- Gate in a few more instance decls --------------------------------- When we have instance T a where... we need to suck in the instance decl rather more aggressively than we were. (A case I hadn't thought of because it only happens with undecideable instances.) --- diff --git a/ghc/compiler/iface/TcIface.lhs b/ghc/compiler/iface/TcIface.lhs index 51bf028..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} %************************************************************************