From: Ian Lynagh Date: Mon, 9 Jul 2007 18:22:09 +0000 (+0000) Subject: Tweak the undecidable-instance-checking logic X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=a4980c2c58727d4337b48b7e4a7dcd4747d0fec7;hp=9eb79d53316804b4c384b5084825112c48f1bbc4 Tweak the undecidable-instance-checking logic Just looking at Opt_GlasgowExts is not sufficient to see if we need to do an instance undecidability check. Rather than try to enumerate all the extensions that may require us to do the check we now always do it. --- diff --git a/compiler/typecheck/TcMType.lhs b/compiler/typecheck/TcMType.lhs index e5ccbd0..9746e0c 100644 --- a/compiler/typecheck/TcMType.lhs +++ b/compiler/typecheck/TcMType.lhs @@ -1179,15 +1179,15 @@ instTypeErr pp_ty msg \begin{code} checkValidInstance :: [TyVar] -> ThetaType -> Class -> [TcType] -> TcM () checkValidInstance tyvars theta clas inst_tys - = do { gla_exts <- doptM Opt_GlasgowExts - ; undecidable_ok <- doptM Opt_AllowUndecidableInstances + = do { undecidable_ok <- doptM Opt_AllowUndecidableInstances ; checkValidTheta InstThetaCtxt theta ; checkAmbiguity tyvars theta (tyVarsOfTypes inst_tys) -- Check that instance inference will terminate (if we care) - -- For Haskell 98, checkValidTheta has already done that - ; when (gla_exts && not undecidable_ok) $ + -- For Haskell 98 this will already have been done by checkValidTheta, + -- but as we may be using other extensions we need to check. + ; unless undecidable_ok $ mapM_ addErrTc (checkInstTermination inst_tys theta) -- The Coverage Condition