Author: marek
Date: 2007-03-25 14:17:19 -0500 (Sun, 25 Mar 2007)
New Revision: 74963
Modified:
trunk/mcs/gmcs/ChangeLog
trunk/mcs/gmcs/generic.cs
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/anonymous.cs
Log:
2007-03-25 Marek Safar <[EMAIL PROTECTED]>
* generic.cs (InferTypeArguments): Infer arguments before they are used
for compatibility check.
2007-03-25 Marek Safar <[EMAIL PROTECTED]>
* anonymous.cs: Restored checks disabled for uninflated anonymous
methods.
Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog 2007-03-25 17:12:05 UTC (rev 74962)
+++ trunk/mcs/gmcs/ChangeLog 2007-03-25 19:17:19 UTC (rev 74963)
@@ -1,3 +1,8 @@
+2007-03-25 Marek Safar <[EMAIL PROTECTED]>
+
+ * generic.cs (InferTypeArguments): Infer arguments before they are used
+ for compatibility check.
+
2007-03-15 Marek Safar <[EMAIL PROTECTED]>
* generic.cs (InflatedConstraints): Fixed the check order.
Modified: trunk/mcs/gmcs/generic.cs
===================================================================
--- trunk/mcs/gmcs/generic.cs 2007-03-25 17:12:05 UTC (rev 74962)
+++ trunk/mcs/gmcs/generic.cs 2007-03-25 19:17:19 UTC (rev 74963)
@@ -2582,19 +2582,20 @@
continue;
AnonymousMethodExpression am =
(AnonymousMethodExpression)a.Expr;
- if (am.Compatible (ec, dtype) != null) {
- if (!InferTypeArguments
(dtype.GetGenericArguments (), am.Parameters.Types, inferred_types))
- return false;
+ if (!InferTypeArguments
(dtype.GetGenericArguments (), am.Parameters.Types, inferred_types))
+ return false;
- Type[] inferred_delegate = new
Type[am.Parameters.Types.Length];
- int index = 0;
- foreach (Type t in
dtype.GetGenericArguments ()) {
-
inferred_delegate[index++] = inferred_types[t.GenericParameterPosition];
- }
- am.AnonymousMethod.DelegateType
= dtype.GetGenericTypeDefinition().MakeGenericType (inferred_delegate);
-
am.AnonymousMethod.AnonymousDelegate.Type = am.AnonymousMethod.DelegateType;
- continue;
+ Type[] inferred_delegate = new
Type[am.Parameters.Types.Length];
+ int index = 0;
+ foreach (Type t in
dtype.GetGenericArguments ()) {
+ inferred_delegate[index++] =
inferred_types[t.GenericParameterPosition];
}
+ Type infered_type =
dtype.GetGenericTypeDefinition ().MakeGenericType (inferred_delegate);
+
+ if (am.Compatible (ec, infered_type) ==
null)
+ return false;
+
+ continue;
}
if (a.Expr is LambdaExpression)
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2007-03-25 17:12:05 UTC (rev 74962)
+++ trunk/mcs/mcs/ChangeLog 2007-03-25 19:17:19 UTC (rev 74963)
@@ -1,5 +1,13 @@
2007-03-25 Marek Safar <[EMAIL PROTECTED]>
+ * anonymous.cs: Restored checks disabled for uninflated anonymous
methods.
+
+2007-03-25 Marek Safar <[EMAIL PROTECTED]>
+
+ * expression.cs: Stop using obsolete 2.0 opcodes.
+
+2007-03-25 Marek Safar <[EMAIL PROTECTED]>
+
* enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
one of the latests Martin's fixes.
Modified: trunk/mcs/mcs/anonymous.cs
===================================================================
--- trunk/mcs/mcs/anonymous.cs 2007-03-25 17:12:05 UTC (rev 74962)
+++ trunk/mcs/mcs/anonymous.cs 2007-03-25 19:17:19 UTC (rev 74963)
@@ -1211,9 +1211,6 @@
return false;
}
- if (TypeManager.IsGenericParameter
(invoke_pd.ParameterType (i)))
- continue;
-
if (invoke_pd.ParameterType (i) !=
Parameters.ParameterType (i)) {
Report.Error (1678, loc, "Parameter
`{0}' is declared as type `{1}' but should be `{2}'",
(i+1).ToString (),
@@ -1277,7 +1274,7 @@
} else {
if (!VerifyExplicitParameterCompatibility
(delegate_type, invoke_pd))
return null;
-
+
parameters = Parameters;
}
@@ -1509,7 +1506,7 @@
public class AnonymousMethod : AnonymousContainer
{
- public Type DelegateType;
+ public readonly Type DelegateType;
//
// The value return by the Compatible call, this ensure that
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches