From 492303f32eb179c14a095aa175541bdbff486179 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Tue, 14 Dec 2010 18:03:44 +0000 Subject: [PATCH] Fix Trac #3731: more superclass subtlety (sigh) I will add more comments, but I want to commit this tonight, so the overnight builds get it. --- compiler/typecheck/TcCanonical.lhs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcCanonical.lhs b/compiler/typecheck/TcCanonical.lhs index 7fdb63e..60d1836 100644 --- a/compiler/typecheck/TcCanonical.lhs +++ b/compiler/typecheck/TcCanonical.lhs @@ -320,7 +320,10 @@ happen. newSCWorkFromFlavored :: EvVar -> CtFlavor -> Class -> [Xi] -> TcS CanonicalCts -- Returns superclasses, see Note [Adding superclasses] newSCWorkFromFlavored ev orig_flavor cls xis - = do { let (tyvars, sc_theta, _, _) = classBigSig cls + | isEmptyVarSet (tyVarsOfTypes xis) + = return emptyCCan + | otherwise + = do { let (tyvars, sc_theta, _, _) = classBigSig cls sc_theta1 = substTheta (zipTopTvSubst tyvars xis) sc_theta ; sc_vars <- zipWithM inst_one sc_theta1 [0..] ; mkCanonicals flavor sc_vars } -- 1.7.10.4