From 1ddce51848468501577f36119920e9e32e93fba8 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Fri, 11 Feb 2011 17:34:15 +0000 Subject: [PATCH] makeSolvedByInst is only called on wanteds This patch just adds an assert error. --- compiler/typecheck/TcSMonad.lhs | 6 ++++-- 1 file 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) -- 1.7.10.4