Use OPTIONS rather than OPTIONS_GHC for pragmas
[ghc-hetmet.git] / compiler / types / InstEnv.lhs
index cc0c2dd..1abcc18 100644 (file)
@@ -7,6 +7,13 @@
 The bits common to TcInstDcls and TcDeriv.
 
 \begin{code}
+{-# OPTIONS -w #-}
+-- The above warning supression flag is a temporary kludge.
+-- While working on this module you are encouraged to remove it and fix
+-- any warnings in the module. See
+--     http://hackage.haskell.org/trac/ghc/wiki/CodingStyle#Warnings
+-- for details
+
 module InstEnv (
        DFunId, OverlapFlag(..),
        Instance(..), pprInstance, pprInstanceHdr, pprInstances, 
@@ -134,7 +141,7 @@ pprInstance :: Instance -> SDoc
 -- Prints the Instance as an instance declaration
 pprInstance ispec@(Instance { is_flag = flag })
   = hang (pprInstanceHdr ispec)
-       2 (ptext SLIT("--") <+> (pprDefnLoc (getSrcLoc ispec)))
+       2 (ptext SLIT("--") <+> (pprDefnLoc (getSrcSpan ispec)))
 
 -- * pprInstanceHdr is used in VStudio to populate the ClassView tree
 pprInstanceHdr :: Instance -> SDoc
@@ -430,10 +437,11 @@ lookupInstEnv (pkg_ie, home_ie) cls tys
     (pkg_matches,  pkg_unifs)  = lookup pkg_ie  
     all_matches = home_matches ++ pkg_matches
     all_unifs   = home_unifs   ++ pkg_unifs
-    pruned_matches 
-       | null all_unifs = foldr insert_overlapping [] all_matches
-       | otherwise      = all_matches  -- Non-empty unifs is always an error situation,
-                                       -- so don't attempt to pune the matches
+    pruned_matches = foldr insert_overlapping [] all_matches
+       -- Even if the unifs is non-empty (an error situation)
+       -- we still prune the matches, so that the error message isn't
+       -- misleading (complaining of multiple matches when some should be
+       -- overlapped away)
 
     --------------
     lookup env = case lookupUFM env cls of