'Run the final unification pass over all inferred types, and
catch imprecise types.'

def unify(self):

    typdict = utils.UniqueDict()
    def check_var(name):
        tv = self.typevars[name]
        if (not tv.defined):
            raise TypingError(("Undefined    variable    '%s'" % (var,)))
        tp = tv.getone()
        if (not tp.is_precise()):
            raise TypingError(("Can't    infer    type    of    variable    '%s':    %s" % (var, tp)))
        typdict[var] = tp
    temps = set((k for k in self.typevars if (not k[0].isalpha())))
    others = (set(self.typevars) - temps)
    for var in sorted(others):
        check_var(var)
    for var in sorted(temps):
        check_var(var)
    retty = self.get_return_type(typdict)
    fntys = self.get_function_types(typdict)
    if self.generator_info:
        retty = self.get_generator_type(typdict, retty)
    self.debug.unify_finished(typdict, retty, fntys)
    return (typdict, retty, fntys)
