X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcInstDcls.lhs;h=f3d37e70108c89e51881e14a0e8fbd1c4963f7a7;hb=5045af3106f3d1e3cb223c254af2de6a8a265797;hp=466cee9d25aa130a121976a046b6d6832ea9313a;hpb=62ee856ca84f409741f472ce3527d6deafa5b62a;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcInstDcls.lhs b/compiler/typecheck/TcInstDcls.lhs index 466cee9..f3d37e7 100644 --- a/compiler/typecheck/TcInstDcls.lhs +++ b/compiler/typecheck/TcInstDcls.lhs @@ -96,9 +96,9 @@ Running example: op1_i = /\a. \(d:C a). let this :: C [a] this = df_i a d + -- Note [Subtle interaction of recursion and overlap] local_op1 :: forall b. Ix b => [a] -> b -> b - -- Note [Subtle interaction of recursion and overlap] local_op1 = -- Source code; run the type checker on this -- NB: Type variable 'a' (but not 'b') is in scope in @@ -614,9 +614,10 @@ tcInstDecl2 (InstInfo { iSpec = ispec, iBinds = NewTypeDerived }) -- Figure out bindings for the superclass context from dfun_dicts -- Don't include this_dict in the 'givens', else - -- sc_dicst get bound by just selecting from this_dict!! + -- sc_dicts get bound by just selecting from this_dict!! ; sc_binds <- addErrCtxt superClassCtxt $ - tcSimplifySuperClasses inst_loc dfun_dicts (rep_dict:sc_dicts) + tcSimplifySuperClasses inst_loc this_dict dfun_dicts + (rep_dict:sc_dicts) -- It's possible that the superclass stuff might unified something -- in the envt with one of the clas_tyvars @@ -735,7 +736,7 @@ tcInstDecl2 (InstInfo { iSpec = ispec, iBinds = VanillaInst monobinds uprags }) -- Don't include this_dict in the 'givens', else -- sc_dicts get bound by just selecting from this_dict!! sc_binds <- addErrCtxt superClassCtxt $ - tcSimplifySuperClasses inst_loc dfun_dicts sc_dicts + tcSimplifySuperClasses inst_loc this_dict dfun_dicts sc_dicts -- Note [Recursive superclasses] -- It's possible that the superclass stuff might unified something