From 9d458d01d2a75b1e452ba00c4e76f3c3d0bc5ba6 Mon Sep 17 00:00:00 2001 From: simonpj Date: Wed, 17 Dec 2003 11:43:13 +0000 Subject: [PATCH] [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.) --- ghc/compiler/iface/TcIface.lhs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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} %************************************************************************ -- 1.7.10.4