[commit: ghc] master: makeSolvedByInst is only called on wanteds (1ddce51)

Simon Marlow marlowsd at gmail.com
Wed Mar 2 16:46:15 CET 2011


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/1ddce51848468501577f36119920e9e32e93fba8

>---------------------------------------------------------------

commit 1ddce51848468501577f36119920e9e32e93fba8
Author: simonpj at microsoft.com <unknown>
Date:   Fri Feb 11 17:34:15 2011 +0000

    makeSolvedByInst is only called on wanteds
    
    This patch just adds an assert error.

>---------------------------------------------------------------

 compiler/typecheck/TcSMonad.lhs |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/compiler/typecheck/TcSMonad.lhs b/compiler/typecheck/TcSMonad.lhs
index 36befd9..27ecb44 100644
--- a/compiler/typecheck/TcSMonad.lhs
+++ b/compiler/typecheck/TcSMonad.lhs
@@ -186,8 +186,10 @@ makeSolvedByInst :: CanonicalCt -> CanonicalCt
 -- 	  Wanted         -> Given
 --	  Given, Derived -> no-op
 makeSolvedByInst ct 
-  | Wanted loc <- cc_flavor ct = ct { cc_flavor = mkGivenFlavor (Wanted loc) UnkSkol }
-  | otherwise                  = ct
+  | Wanted loc <- cc_flavor ct
+  = ct { cc_flavor = Given (setCtLocOrigin loc UnkSkol) }
+  | otherwise	   -- Only called on wanteds
+  = pprPanic "makeSolvedByInst" (ppr ct)
 
 deCanonicalise :: CanonicalCt -> FlavoredEvVar
 deCanonicalise ct = mkEvVarX (cc_id ct) (cc_flavor ct)





More information about the Cvs-ghc mailing list