ptupitsyn commented on a change in pull request #6359: IGNITE-8588 .NET: Serialization issue when derived type hides base type member URL: https://github.com/apache/ignite/pull/6359#discussion_r271163597
########## File path: modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryReflectiveSerializerInternal.cs ########## @@ -152,9 +152,18 @@ bool IBinarySerializerInternal.SupportsHandles if (idMap.ContainsKey(fieldId)) { - throw new BinaryObjectException("Conflicting field IDs [type=" + - type.Name + ", field1=" + idMap[fieldId] + ", field2=" + fieldName + - ", fieldId=" + fieldId + ']'); + string existingFieldName = idMap[fieldId]; + string baseClassName = field.DeclaringType != null ? field.DeclaringType.Name : null; + var msg = string.Format("{0} derives from {1} and hides field {2} from the base class. " + + "Ignite can not serialize two fields with the same name.", type.Name, baseClassName, fieldName); + + if (fieldName != existingFieldName) + { + msg = string.Format("Ignite resolved two fields {0} and {1} to the same fieldId {2}. Probably " + Review comment: Let's keep existing error message by default. Only when `fieldName == existingFieldName` provide the new error message. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services