code: Symbol findGlobalType(Env<AttrContext> env, Scope scope, Name name) {
          Symbol bestSoFar = typeNotFound;
          for (Scope.Entry e = scope.lookup(name); e.scope != null; e = e.next()) {
              Symbol sym = loadClass(env, e.sym.flatName());
              if (bestSoFar.kind == TYP && sym.kind == TYP &&
                  bestSoFar != sym)
                  return new AmbiguityError(bestSoFar, sym);
              else if (sym.kind < bestSoFar.kind)
                  bestSoFar = sym;
          }
          return bestSoFar;
      }
docs: Find a global type in given scope and load corresponding class.
  @param env       The current environment.
  @param scope     The scope in which to look for the type.
  @param name      The type's name.