+2010-04-28 Marek Safar <marek.safar@gmail.com>
+
+ A fix for bug #600398
+ * convert.cs: Actually use effective base type for the comparison.
+
2010-04-28 Marek Safar <marek.safar@gmail.com>
A fix for bug #600326
// From T to any base class of C
// From T to any interface implemented by C
//
- var base_type = expr_type.BaseType;
+ var base_type = expr_type.GetEffectiveBase ();
if (base_type == target_type || TypeManager.IsSubclassOf (base_type, target_type) || base_type.ImplementsInterface (target_type)) {
if (expr_type.IsReferenceType)
return new ClassCast (expr, target_type);
return new BoxedCast (expr, target_type);
}
- base_type = expr_type.GetEffectiveBase ();
-
var effective_ifaces = expr_type.Interfaces;
if (effective_ifaces != null) {
foreach (var t in effective_ifaces) {