[project @ 2001-05-03 08:13:25 by simonpj]
[ghc-hetmet.git] / ghc / compiler / typecheck / TcInstDcls.lhs
index 1a38a13..9b478e0 100644 (file)
@@ -52,7 +52,7 @@ import FunDeps                ( checkInstFDs )
 import Generics                ( validGenericInstanceType )
 import Module          ( Module, foldModuleEnv )
 import Name            ( getSrcLoc )
-import NameSet         ( emptyNameSet, mkNameSet, nameSetToList )
+import NameSet         ( emptyNameSet, unitNameSet, nameSetToList )
 import PrelInfo                ( eRROR_ID )
 import PprType         ( pprClassPred, pprPred )
 import TyCon           ( TyCon, isSynTyCon )
@@ -601,7 +601,7 @@ tcInstDecl2 (InstInfo { iDFunId = dfun_id,
         dict_constr   = classDataCon clas
        scs_and_meths = map instToId (sc_dicts ++ meth_insts)
        this_dict_id  = instToId this_dict
-       inlines       = mkNameSet [idName dfun_id | InlineInstSig _ _ <- uprags]
+       inlines       = unitNameSet (idName dfun_id)
 
        dict_rhs
          | null scs_and_meths
@@ -729,7 +729,8 @@ check_tyvars dflags clas inst_taus
   | otherwise                                = [the_err]
   where
     the_err = instTypeErr clas inst_taus msg
-    msg     = ptext SLIT("There must be at least one non-type-variable in the instance head")
+    msg     =  ptext SLIT("There must be at least one non-type-variable in the instance head")
+           $$ ptext SLIT("Use -fallow-undecidable-instances to lift this restriction")
 
 check_fundeps dflags theta clas inst_taus
   | checkInstFDs theta clas inst_taus = []