From: simonpj Date: Fri, 19 Mar 2004 13:25:24 +0000 (+0000) Subject: [project @ 2004-03-19 13:25:24 by simonpj] X-Git-Tag: Initial_conversion_from_CVS_complete~1952 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=45deb4d603c392ac8f404052e7c68ce12f05538b;p=ghc-hetmet.git [project @ 2004-03-19 13:25:24 by simonpj] Add comments --- diff --git a/ghc/compiler/typecheck/TcSimplify.lhs b/ghc/compiler/typecheck/TcSimplify.lhs index 91ca3b8..a3e9352 100644 --- a/ghc/compiler/typecheck/TcSimplify.lhs +++ b/ghc/compiler/typecheck/TcSimplify.lhs @@ -912,6 +912,22 @@ Plan C (brutal) Return the bindings from Step 1. +A note about Plan C (arising from "bug" reported by George Russel March 2004) +Consider this: + + instance (HasBinary ty IO) => HasCodedValue ty + + foo :: HasCodedValue a => String -> IO a + + doDecodeIO :: HasCodedValue a => () -> () -> IO a + doDecodeIO codedValue view + = let { act = foo "foo" } in act + +You might think this should work becuase the call to foo gives rise to a constraint +(HasCodedValue t), which can be satisfied by the type sig for doDecodeIO. But the +restricted binding act = ... calls tcSimplifyRestricted, and PlanC simplifies the +constraint using the (rather bogus) instance declaration, and now we are stuffed. +I claim this is not really a bug. \begin{code} tcSimplifyRestricted -- Used for restricted binding groups