docs: ScopeState visibilityIn(String pkg, QualifiedName type) {
      if (pkg == null) {
        return visibilityIn(UNIVERSALLY_VISIBLE_PACKAGE, type);
      } else if (isTopLevelType(pkg, type.getSimpleName())) {
        if (type.isTopLevel() && type.getPackage().equals(pkg)) {
          return ScopeState.IN_SCOPE;
        } else {
          return ScopeState.HIDDEN;
        }
      } else if (!pkg.equals(UNIVERSALLY_VISIBLE_PACKAGE)) {
        return visibilityIn(UNIVERSALLY_VISIBLE_PACKAGE, type);
      } else {
        return ScopeState.IMPORTABLE;
      }
    }