X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcDefaults.lhs;fp=ghc%2Fcompiler%2Ftypecheck%2FTcDefaults.lhs;h=b9b74c3cd0f4d318c63d26658323eda6a6d3f3bd;hb=087fdd53c7d6bb6cb17574133abc2de4f1816c7e;hp=d44bebc54bdcf2534a829cfb67510133fc44f2a1;hpb=51c3d221c00fc4d97ab4428255a6e8fe475b0050;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcDefaults.lhs b/ghc/compiler/typecheck/TcDefaults.lhs index d44bebc..b9b74c3 100644 --- a/ghc/compiler/typecheck/TcDefaults.lhs +++ b/ghc/compiler/typecheck/TcDefaults.lhs @@ -18,8 +18,9 @@ import TcSimplify ( tcSimplifyCheckThetas ) import TysWiredIn ( integerTy, doubleTy ) import Type ( Type ) -import PrelNames ( numClassKey ) +import PrelNames ( numClassName ) import Outputable +import HscTypes ( TyThing(..) ) \end{code} \begin{code} @@ -38,9 +39,9 @@ tc_defaults [DefaultDecl [] locn] tc_defaults [DefaultDecl mono_tys locn] = tcLookupGlobal_maybe numClassName `thenNF_Tc` \ maybe_num -> - case maybe_num of { + case maybe_num of Just (AClass num_class) -> common_case num_class - other -> returnTc [] ; + other -> returnTc [] -- In the Nothing case, Num has not been sucked in, so the -- defaults will never be used; so simply discard the default decl. -- This slightly benefits modules that don't use any @@ -59,7 +60,7 @@ tc_defaults [DefaultDecl mono_tys locn] [ (num_class, [ty]) | ty <- tau_tys ] `thenTc_` returnTc tau_tys - } + tc_defaults decls@(DefaultDecl _ loc : _) = tcAddSrcLoc loc $