[project @ 2000-06-10 00:34:52 by lewie]
authorlewie <unknown>
Sat, 10 Jun 2000 00:34:52 +0000 (00:34 +0000)
committerlewie <unknown>
Sat, 10 Jun 2000 00:34:52 +0000 (00:34 +0000)
Update instFunDepsOfTheta to accomodate Simon's recent commit (it hadn't
needed to generate fundeps for IParams previously).  This undoes Simon's
comment about `forall a. ?x::a => Int' being ambiguous.  It isn't, and
now it isn't flagged as such either.  I.e, there's nothing wrong with:
    foo :: ?x::a => Int
    foo = fst (13, ?x)
(of course, less contrived examples can also be given!).

ghc/compiler/typecheck/Inst.lhs
ghc/compiler/typecheck/TcBinds.lhs

index 7ccc480..d4565d0 100644 (file)
@@ -398,7 +398,7 @@ instFunDeps orig theta
 
 instFunDepsOfTheta theta
   = let ifd (Class clas tys) = instantiateFdClassTys clas tys
-       ifd _ = []
+       ifd (IParam n ty)    = [([], [ty])]
     in concat (map ifd theta)
 
 newMethodWithGivenTy orig id tys theta tau
index ad10729..3e28615 100644 (file)
@@ -554,7 +554,6 @@ getTyVarsToGen is_unrestricted mono_id_tys lie
        let tvFundep        = tyVarFunDep fds'
            extended_tyvars = oclose tvFundep body_tyvars
        in
-       -- pprTrace "gTVTG" (ppr (lie, body_tyvars, extended_tyvars)) $
        returnNF_Tc (emptyVarSet, extended_tyvars)
     else
        -- This recover and discard-errs is to avoid duplicate error