private Field cloneWithNewType(@NotNull YamlMetaType newType) {
    var result = newField(newType);

    result.myIsRequired = myIsRequired;
    result.myEditable = myEditable;
    result.myDeprecated = myDeprecated;
    result.myNamePattern = myNamePattern;
    result.myEmptyValueAllowed = myEmptyValueAllowed;
    result.myIsMany = myIsMany;
    result.myOverriddenDefaultRelation = myOverriddenDefaultRelation;
    result.myPerRelationTypes.putAll(myPerRelationTypes);

    return result;
  }
private Field cloneWithNewType(@NotNull YamlMetaType newType)