types2: fix bug in generalize by changing from list to Set in freeTypeVars