зеркало из https://github.com/stride3d/SharpYaml.git
Fix deserialization of generic dictionaries that use explicit implementation of the Add method
This commit is contained in:
Родитель
d9a5b8bdf1
Коммит
66bb32b63e
|
@ -83,15 +83,15 @@ namespace SharpYaml.Serialization.Descriptors
|
|||
keyType = interfaceType.GetGenericArguments()[0];
|
||||
valueType = interfaceType.GetGenericArguments()[1];
|
||||
IsGenericDictionary = true;
|
||||
getEnumeratorGeneric = typeof (DictionaryDescriptor).GetMethod("GetGenericEnumerable").MakeGenericMethod(keyType, valueType);
|
||||
getEnumeratorGeneric = typeof(DictionaryDescriptor).GetMethod("GetGenericEnumerable").MakeGenericMethod(keyType, valueType);
|
||||
addMethod = interfaceType.GetMethod("Add", new[] { keyType, valueType });
|
||||
}
|
||||
else
|
||||
{
|
||||
keyType = typeof(object);
|
||||
valueType = typeof(object);
|
||||
addMethod = type.GetMethod("Add", new[] { keyType, valueType });
|
||||
}
|
||||
|
||||
addMethod = type.GetMethod("Add", new[] { keyType, valueType });
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
|
|
Загрузка…
Ссылка в новой задаче