Author: marek
Date: 2007-08-23 11:17:06 -0400 (Thu, 23 Aug 2007)
New Revision: 84702
Modified:
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/anonymous.cs
Log:
2007-08-23 Marek Safar <[EMAIL PROTECTED]>
* anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
The number of delegate parameters has to match.
(AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
arrays.
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2007-08-23 15:06:36 UTC (rev 84701)
+++ trunk/mcs/mcs/ChangeLog 2007-08-23 15:17:06 UTC (rev 84702)
@@ -1,3 +1,10 @@
+2007-08-23 Marek Safar <[EMAIL PROTECTED]>
+
+ * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
+ The number of delegate parameters has to match.
+ (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
+ arrays.
+
2007-08-21 Marek Safar <[EMAIL PROTECTED]>
* anonymous.cs (AnonymousMethod): Generate private anonymous method
Modified: trunk/mcs/mcs/anonymous.cs
===================================================================
--- trunk/mcs/mcs/anonymous.cs 2007-08-23 15:06:36 UTC (rev 84701)
+++ trunk/mcs/mcs/anonymous.cs 2007-08-23 15:17:06 UTC (rev 84702)
@@ -1225,10 +1225,15 @@
continue;
}
+ Type type = invoke_pd.Types [i];
+
// We assume that generic parameters are always
inflated
- if (TypeManager.IsGenericParameter
(invoke_pd.Types[i]))
+ if (TypeManager.IsGenericParameter (type))
continue;
+ if (TypeManager.HasElementType (type) &&
TypeManager.IsGenericParameter (TypeManager.GetElementType (type)))
+ continue;
+
if (invoke_pd.ParameterType (i) !=
Parameters.ParameterType (i)) {
if (ignoreErrors)
return false;
@@ -1256,12 +1261,18 @@
return;
ParameterData d_params =
TypeManager.GetDelegateParameters (delegateType);
+ if (d_params.Count != Parameters.Count)
+ return;
for (int i = 0; i < Parameters.Count; ++i) {
Type itype = d_params.Types [i];
- if (!TypeManager.IsGenericParameter (itype))
- continue;
-
+ if (!TypeManager.IsGenericParameter (itype)) {
+ if (!itype.HasElementType)
+ continue;
+
+ if (!TypeManager.IsGenericParameter
(itype.GetElementType ()))
+ continue;
+ }
typeInference.ExactInference
(Parameters.FixedParameters[i].ParameterType, itype);
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches