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!).
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
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