'Resolve the type inference for \'elem\' at \'scoperef\'.'

def _hits_from_variable_type_inference(self, hit, resolve_var=True):

    assert self._hit_helper.is_variable(hit)
    (elem, scoperef) = hit
    citdl = elem.get('citdl')
    if (not citdl):
        raise CodeIntelError(('_hit_from_variable_type_inference:    no    type-inference    info    for    %r' % elem))
    if (citdl in self._visited_variables):
        self.log("_hit_from_variable_type_inference:    already    looked    at    var    '%s'", citdl)
        return NO_HITS
    self._visited_variables[citdl] = None
    self.log("_hit_from_variable_type_inference:    resolve    '%s'    type    inference    for    %r:", citdl, elem)
    self._base_scoperefs.insert(0, scoperef)
    try:
        hits = self._hits_from_citdl(citdl, resolve_var)
    finally:
        del self._base_scoperefs[0]
    self.debug("_hits_from_variable_type_inference(%s)    (citdl    '%r')    ==>    '%r'", elem.get('name'), citdl, hits)
    return hits
