code: Symbol findIdent(Env<AttrContext> env, Name name, KindSelector kind) {
          Symbol bestSoFar = typeNotFound;
          Symbol sym;
  
          if (kind.contains(KindSelector.VAL)) {
              sym = findVar(env, name);
              if (sym.exists()) return sym;
              else bestSoFar = bestOf(bestSoFar, sym);
          }
  
          if (kind.contains(KindSelector.TYP)) {
              sym = findType(env, name);
  
              if (sym.exists()) return sym;
              else bestSoFar = bestOf(bestSoFar, sym);
          }
  
          if (kind.contains(KindSelector.PCK))
              return lookupPackage(env, name);
          else return bestSoFar;
      }
docs: Find an unqualified identifier which matches a specified kind set.
  @param env       The current environment.
  @param name      The identifier's name.
  @param kind      Indicates the possible symbol kinds
  (a subset of VAL, TYP, PCK).