code: private ClassName resolve(String simpleName) {
      // Match a child of the current (potentially nested) class.
      for (int i = typeSpecStack.size() - 1; i >= 0; i--) {
        TypeSpec typeSpec = typeSpecStack.get(i);
        if (typeSpec.nestedTypesSimpleNames.contains(simpleName)) {
          return stackClassName(i, simpleName);
        }
      }
  
      // Match the top-level class.
      if (typeSpecStack.size() > 0 && Objects.equals(typeSpecStack.get(0).name, simpleName)) {
        return ClassName.get(packageName, simpleName);
      }
  
      // Match an imported type.
      ClassName importedType = importedTypes.get(simpleName);
      if (importedType != null) return importedType;
  
      // No match.
      return null;
    }
docs: TODO(jwilson): also honor superclass members when resolving names.