    # File lib/yard/registry.rb, line 270
          def resolve(namespace, name, inheritance = false, proxy_fallback = false, type = nil)
            if namespace.is_a?(CodeObjects::Proxy)
              return proxy_fallback ? CodeObjects::Proxy.new(namespace, name, type) : nil
            end

            if namespace == :root || !namespace
              namespace = root
            else
              namespace = namespace.parent until namespace.is_a?(CodeObjects::NamespaceObject)
            end
            orignamespace = namespace

            name = name.to_s
            if name =~ /^#{CodeObjects::NSEPQ}/
              [name, name[2..-1]].each do |n|
                found = at(n)
                return found if found && (type.nil? || found.type == type)
              end
            else
              while namespace
                if namespace.is_a?(CodeObjects::NamespaceObject)
                  if inheritance
                    nss = namespace.inheritance_tree(true)
                    if namespace.respond_to?(:superclass)
                      if namespace.superclass != P('BasicObject')
                        nss |= [P('Object')]
                      end
                      nss |= [P('BasicObject')]
                    end
                  else
                    nss = [namespace]
                  end
                  nss.each do |ns|
                    next if ns.is_a?(CodeObjects::Proxy)
                    found = partial_resolve(ns, name, type)
                    return found if found
                  end
                end
                namespace = namespace.parent
              end
            end
            proxy_fallback ? CodeObjects::Proxy.new(orignamespace, name, type) : nil
          end