':see Expression._set_type()'

def _set_type(self, other_type=ANY_TYPE, signature=None):

    assert isinstance(other_type, Type)
    if (signature is None):
        signature = defaultdict(list)
    if (other_type == ANY_TYPE):
        resolution = ENTITY_TYPE
    else:
        resolution = other_type
        if (self.type != ENTITY_TYPE):
            resolution = resolution.resolve(self.type)
    for varEx in signature[self.variable.name]:
        resolution = varEx.type.resolve(resolution)
        if (not resolution):
            raise InconsistentTypeHierarchyException(self)
    signature[self.variable.name].append(self)
    for varEx in signature[self.variable.name]:
        varEx.type = resolution
