def direct_lookup(self, key: 'LookupKey') -> 'Symbol':
    if Symbol.debug_lookup:
        Symbol.debug_indent += 1
        Symbol.debug_print('direct_lookup:')
        Symbol.debug_indent += 1
    s = self
    for (name, templateParams, id_) in key.data:
        if (id_ is not None):
            res = None
            for cand in s._children:
                if (cand.declaration is None):
                    continue
                if (cand.declaration.get_newest_id() == id_):
                    res = cand
                    break
            s = res
        else:
            identOrOp = name.identOrOp
            templateArgs = name.templateArgs
            s = s._find_first_named_symbol(identOrOp, templateParams, templateArgs, templateShorthand=False, matchSelf=False, recurseInAnon=False, correctPrimaryTemplateArgs=False)
        if Symbol.debug_lookup:
            Symbol.debug_print('name:          ', name)
            Symbol.debug_print('templateParams:', templateParams)
            Symbol.debug_print('id:            ', id_)
            if (s is not None):
                print(s.to_string((Symbol.debug_indent + 1)), end='')
            else:
                Symbol.debug_print('not found')
        if (s is None):
            if Symbol.debug_lookup:
                Symbol.debug_indent -= 2
            return None
    if Symbol.debug_lookup:
        Symbol.debug_indent -= 2
    return s
def direct_lookup(self, key: 'LookupKey') -> 'Symbol':
    if Symbol.debug_lookup:
        Symbol.debug_indent += 1
        Symbol.debug_print('direct_lookup:')
        Symbol.debug_indent += 1
    s = self
    for (name, templateParams, id_) in key.data:
        if (id_ is not None):
            res = None
            for cand in s._children:
                if (cand.declaration is None):
                    continue
                if (cand.declaration.get_newest_id() == id_):
                    res = cand
                    break
            s = res
        else:
            identOrOp = name.identOrOp
            templateArgs = name.templateArgs
            s = s._find_first_named_symbol(identOrOp, templateParams, templateArgs, templateShorthand=False, matchSelf=False, recurseInAnon=False, correctPrimaryTemplateArgs=False)
        if Symbol.debug_lookup:
            Symbol.debug_print('name:          ', name)
            Symbol.debug_print('templateParams:', templateParams)
            Symbol.debug_print('id:            ', id_)
            if (s is not None):
                print(s.to_string((Symbol.debug_indent + 1)), end=)
            else:
                Symbol.debug_print('not found')
        if (s is None):
            if Symbol.debug_lookup:
                Symbol.debug_indent -= 2
            return None
    if Symbol.debug_lookup:
        Symbol.debug_indent -= 2
    return s