X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcInstDcls.lhs;h=79ac5401431e065b2e851e24cfdd78924e8314a5;hb=b085ee40c7f265a5977ea6ec1c415e573be5ff8c;hp=ebe4b26d46c7140b908c7af464663f10f1b2034e;hpb=13878c136b4e6b676dbc859f378809676f4d679c;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcInstDcls.lhs b/ghc/compiler/typecheck/TcInstDcls.lhs index ebe4b26..79ac540 100644 --- a/ghc/compiler/typecheck/TcInstDcls.lhs +++ b/ghc/compiler/typecheck/TcInstDcls.lhs @@ -53,7 +53,7 @@ import DataCon ( classDataCon ) import Class ( Class, classBigSig ) import Var ( idName, idType ) import Id ( setIdLocalExported ) -import MkId ( mkDictFunId, unsafeCoerceId, eRROR_ID ) +import MkId ( mkDictFunId, unsafeCoerceId, rUNTIME_ERROR_ID ) import FunDeps ( checkInstFDs ) import Generics ( validGenericInstanceType ) import Module ( Module, foldModuleEnv ) @@ -65,12 +65,14 @@ import SrcLoc ( SrcLoc ) import Unique ( Uniquable(..) ) import Util ( lengthExceeds, isSingleton ) import BasicTypes ( NewOrData(..) ) +import UnicodeUtil ( stringToUtf8 ) import ErrUtils ( dumpIfSet_dyn ) import ListSetOps ( Assoc, emptyAssoc, plusAssoc_C, mapAssoc, assocElts, extendAssoc_C, equivClassesByUniq, minusList ) import Maybe ( catMaybes ) import Outputable +import FastString \end{code} Typechecking instance declarations is done in two passes. The first @@ -617,8 +619,8 @@ tcInstDecl2 (InstInfo { iDFunId = dfun_id, iBinds = monobinds, iPrags = uprags } -- emit an error message. This in turn means that we don't -- mention the constructor, which doesn't exist for CCallable, CReturnable -- Hardly beautiful, but only three extra lines. - HsApp (TyApp (HsVar eRROR_ID) [idType this_dict_id]) - (HsLit (HsString msg)) + HsApp (TyApp (HsVar rUNTIME_ERROR_ID) [idType this_dict_id]) + (HsLit (HsStringPrim (mkFastString (stringToUtf8 msg)))) | otherwise -- The common case = mkHsConApp dict_constr inst_tys' (map HsVar scs_and_meths) @@ -630,7 +632,7 @@ tcInstDecl2 (InstInfo { iDFunId = dfun_id, iBinds = monobinds, iPrags = uprags } -- than needing to be repeated here. where - msg = _PK_ ("Compiler error: bad dictionary " ++ showSDoc (ppr clas)) + msg = "Compiler error: bad dictionary " ++ showSDoc (ppr clas) dict_bind = VarMonoBind this_dict_id dict_rhs meth_binds = andMonoBindList meth_binds_s