docs: private static Iterable<Symbol> typesInEnclosingScope(
        Env<AttrContext> env, PackageSymbol javaLang) {
      // Collect all visible type names declared in this source file by ascending lexical scopes,
      // collecting all members, filtering to keep type symbols and exclude TypeVariableSymbols
      // (otherwise, every type parameter spuriously shadows itself)
      Iterable<Symbol> localSymbolsInScope =
          Streams.stream(env)
              .map(
                  ctx ->
                      ctx.tree.getTag() == Tag.CLASSDEF
                          ? ((ClassSymbol) ASTHelpers.getSymbol(ctx.tree)).members().getSymbols()
                          : ctx.info.getLocalElements())
              .flatMap(
                  symbols ->
                      Streams.stream(symbols)
                          .filter(
                              sym ->
                                  sym instanceof TypeSymbol && !(sym instanceof TypeVariableSymbol)))
              .collect(ImmutableList.toImmutableList());
  
      // Concatenate with all visible type names declared in other source files:
      // Ignore wildcard imports here since we don't use them and they can cause issues (b/109867096)
      return Iterables.concat(
          localSymbolsInScope, // Local symbols
          env.toplevel.namedImportScope.getSymbols(), // Explicitly named imports
          javaLang.members().getSymbols(), // implicitly imported java.lang.* symbols
          env.toplevel.packge.members().getSymbols()); // Siblings in class hierarchy
    }