X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcSimplify.lhs;h=5d430e63365c8aec4cfcae080a72ddf9a53426a3;hb=a76db2a07f99716c40e05d73210f80b4e4794b9a;hp=336eeb60b953d15bf50fe3536e2cea0cb34e2c56;hpb=ecd5cb36ad575939b04f40d1b3a7255741f294a2;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcSimplify.lhs b/ghc/compiler/typecheck/TcSimplify.lhs index 336eeb6..5d430e6 100644 --- a/ghc/compiler/typecheck/TcSimplify.lhs +++ b/ghc/compiler/typecheck/TcSimplify.lhs @@ -123,7 +123,6 @@ module TcSimplify ( #include "HsVersions.h" -import CmdLineOpts ( opt_MaxContextReductionDepth, dopt_GlasgowExts, opt_WarnTypeDefaults ) import HsSyn ( MonoBinds(..), HsExpr(..), andMonoBinds, andMonoBindList ) import TcHsSyn ( TcExpr, TcId, TcMonoBinds, TcDictBinds @@ -144,7 +143,7 @@ import Inst ( lookupInst, lookupSimpleInst, LookupInstResult(..), lieToList ) import TcEnv ( tcGetGlobalTyVars, tcGetInstEnv ) -import TcInstUtil ( lookupInstEnv, InstLookupResult(..) ) +import InstEnv ( lookupInstEnv, InstLookupResult(..) ) import TcType ( TcTyVarSet ) import TcUnify ( unifyTauTy ) @@ -167,6 +166,7 @@ import Util ( zipEqual, mapAccumL ) import List ( partition ) import Maybe ( fromJust ) import Maybes ( maybeToBool ) +import CmdLineOpts \end{code} @@ -848,7 +848,7 @@ tcSimplifyThetas :: ClassContext -- Wanted -> TcM ClassContext -- Needed tcSimplifyThetas wanteds - = doptsTc dopt_GlasgowExts `thenNF_Tc` \ glaExts -> + = doptsTc Opt_GlasgowExts `thenNF_Tc` \ glaExts -> reduceSimple [] wanteds `thenNF_Tc` \ irreds -> let -- For multi-param Haskell, check that the returned dictionaries @@ -1226,11 +1226,9 @@ addAmbigErr ambig_tv_fn dict (tidy_env, tidy_dict) = tidyInst emptyTidyEnv dict warnDefault dicts default_ty - | not opt_WarnTypeDefaults - = returnNF_Tc () + = doptsTc Opt_WarnTypeDefaults `thenTc` \ warn -> + if warn then warnTc True msg else returnNF_Tc () - | otherwise - = warnTc True msg where msg | length dicts > 1 = (ptext SLIT("Defaulting the following constraint(s) to type") <+> quotes (ppr default_ty))