* Binder.cs: don't crash when we have a 'null' argument Type array.
Allow it for non-value types. Fixed for both, methods and properties.
Closes bug #58846.
svn path=/trunk/mcs/; revision=28859
private static bool check_type (Type from, Type to) {
if (from == to)
return true;
+
+ if (from == null)
+ return !to.IsValueType;
+
TypeCode fromt = Type.GetTypeCode (from);
TypeCode tot = Type.GetTypeCode (to);
return worst;
}
- // 0 -> same type
+ // 0 -> same type or null and !valuetype
// 1 -> to == Enum
// 2 -> value type that don't lose data
// 3 -> to == IsAssignableFrom
// 4 -> to == object
static int check_type_with_score (Type from, Type to)
{
+ if (from == null)
+ return to.IsValueType ? -1 : 0;
+
if (from == to)
return 0;
+2004-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Binder.cs: don't crash when we have a 'null' argument Type array.
+ Allow it for non-value types. Fixed for both, methods and properties.
+ Closes bug #58846.
+
2004-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Binder.cs: default score must be lower than fail_score or we'll get