I've ran into a problem with Converter.ToManaged when trying to call
ILGenerator.EmitCall. EmitCall demands its last parameter (of type
System.Type[]) to be null for non-varargs methods but Converter.ToManager
wouldn't convert None to a null reference.
My solution was simply to move the explicit check for Runtime.PyNone to the
line 186, before the IsArray check:
<snip>
if (value == Runtime.PyNone && !obType.IsValueType) {
result = null;
return true;
}
if (obType.IsArray) {
return ToArray(value, obType, out result, setError);
}
if (obType.IsEnum) {
return ToEnum(value, obType, out result, setError);
}
</snip>
Is this correct?
Best wishes,
Rodrigo