Fix the trimming of bind_fvs (fixes Trac #5439)
For the bind_fvs field of FunBind/PatBind, we need to be careful to keep track of uses of all functions in this module (although not imported ones). Moreover in TcBinds.decideGeneralisationPlan we need to take note of uses of lexically scoped type variables. These two buglets led to a (useful) assertion failure in TcEnv.
Showing with 121 additions and 49 deletions