Make methodswith check TypeVar.ub
Merge pull request #6658 from ihnorton/fix5722

Fix #5722 by making methodswith check TypeVar.ub