Author: martin
Date: 2006-03-23 13:23:19 -0500 (Thu, 23 Mar 2006)
New Revision: 58373
Modified:
trunk/mcs/gmcs/ChangeLog
trunk/mcs/gmcs/expression.cs
Log:
2006-03-23 Martin Baulig <[EMAIL PROTECTED]>
* expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
type check if either of the types is an open generic type.
Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog 2006-03-23 18:09:36 UTC (rev 58372)
+++ trunk/mcs/gmcs/ChangeLog 2006-03-23 18:23:19 UTC (rev 58373)
@@ -1,5 +1,10 @@
2006-03-23 Martin Baulig <[EMAIL PROTECTED]>
+ * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
+ type check if either of the types is an open generic type.
+
+2006-03-23 Martin Baulig <[EMAIL PROTECTED]>
+
* convert.cs
(Convert.ExplicitTypeParameterConversion): New method; implement
explicit type parameter conversions.
Modified: trunk/mcs/gmcs/expression.cs
===================================================================
--- trunk/mcs/gmcs/expression.cs 2006-03-23 18:09:36 UTC (rev 58372)
+++ trunk/mcs/gmcs/expression.cs 2006-03-23 18:23:19 UTC (rev 58373)
@@ -1184,6 +1184,9 @@
action = Action.AlwaysFalse;
else
action = Action.Probe;
+ } else if (etype.ContainsGenericParameters ||
probe_type.ContainsGenericParameters) {
+ expr = new BoxedCast (expr, etype);
+ action = Action.Probe;
} else {
action = Action.AlwaysFalse;
warning_never_matches = true;
@@ -1288,6 +1291,12 @@
return this;
}
+ if (etype.ContainsGenericParameters ||
type.ContainsGenericParameters) {
+ expr = new BoxedCast (expr, etype);
+ do_isinst = true;
+ return this;
+ }
+
Error_CannotConvertType (etype, type, loc);
return null;
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches