Author: raja
Date: 2006-03-27 07:22:08 -0500 (Mon, 27 Mar 2006)
New Revision: 58571
Modified:
trunk/mcs/gmcs/
trunk/mcs/gmcs/ChangeLog
trunk/mcs/gmcs/anonymous.cs
trunk/mcs/gmcs/convert.cs
trunk/mcs/gmcs/delegate.cs
trunk/mcs/gmcs/ecore.cs
Log:
*** merged revisions from mcs: 57750, 58144
Property changes on: trunk/mcs/gmcs
___________________________________________________________________
Name: gmcs
- Latest GMCS merging status:
- merged everything until r57580 (on 2006-03-04).
- not merging r49122, ie. we're keeping r48609 and r48610; see #75925.
- r37007 will never be merged; it's a mcs-only change.
- r43124 doesn't work in GMCS; not merged yet.
+ Latest GMCS merging status:
- merged everything until r57750 (on 2006-03-10).
- merged r58144 too
- not merging r49122, ie. we're keeping r48609 and r48610; see #75925.
- r37007 will never be merged; it's a mcs-only change.
- r43124 doesn't work in GMCS; not merged yet.
Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog 2006-03-27 11:40:03 UTC (rev 58570)
+++ trunk/mcs/gmcs/ChangeLog 2006-03-27 12:22:08 UTC (rev 58571)
@@ -1,3 +1,26 @@
+2006-03-18 Marek Safar <[EMAIL PROTECTED]>
+
+ A fix for #77822.
+
+ * expression.cs (VerifyArgumentsCompat): Reverted to double error
+ reporting, it's more tricky than I thought.
+
+2006-03-09 Marek Safar <[EMAIL PROTECTED]>
+
+ * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
+ were not resolved
+
+ * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free
MemberLookup.
+ (DelegateCreation.ImplicitStandardConversionExists): New method for just
+ conversion test.
+
+ *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
+ not needed.
+
+ * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
+ Updated after another emitcontext usage was clean up. It should help us
to
+ synchronize with gmcs easier.
+
2006-03-04 Marek Safar <[EMAIL PROTECTED]>
A fix for #77353.
Modified: trunk/mcs/gmcs/anonymous.cs
===================================================================
--- trunk/mcs/gmcs/anonymous.cs 2006-03-27 11:40:03 UTC (rev 58570)
+++ trunk/mcs/gmcs/anonymous.cs 2006-03-27 12:22:08 UTC (rev 58571)
@@ -551,7 +551,7 @@
if ((am.method.ModFlags & Modifiers.STATIC) == 0)
delegate_instance_expression = new
AnonymousInstance (am);
- Expression ml = Expression.MemberLookup (ec, type,
".ctor", loc);
+ Expression ml = Expression.MemberLookup
(ec.ContainerType, type, ".ctor", loc);
constructor_method = ((MethodGroupExpr) ml).Methods [0];
delegate_method = am.GetMethodBuilder ();
base.Emit (ec);
Modified: trunk/mcs/gmcs/convert.cs
===================================================================
--- trunk/mcs/gmcs/convert.cs 2006-03-27 11:40:03 UTC (rev 58570)
+++ trunk/mcs/gmcs/convert.cs 2006-03-27 12:22:08 UTC (rev 58571)
@@ -19,16 +19,7 @@
// A container class for all the conversion operations
//
public class Convert {
- //
- // This is used to prettify the code: a null argument is allowed
- // for ImplicitStandardConversion as long as it is known that
- // no anonymous method will play a role.
- //
- // FIXME: renamed from `const' to `static' to allow
bootstraping from older
- // versions of the compiler that could not cope with this
construct.
- //
- public static EmitContext ConstantEC = null;
-
+
static Expression TypeParameter_to_Null (Type target_type,
Location loc)
{
if (!TypeParameter_to_Null (target_type)) {
@@ -620,12 +611,7 @@
if (ImplicitStandardConversionExists (expr,
target_type))
return true;
- Expression dummy = ImplicitUserConversion (ec, expr,
target_type, Location.Null);
-
- if (dummy != null)
- return true;
-
- return false;
+ return ImplicitUserConversion (ec, expr, target_type,
Location.Null) != null;
}
public static bool ImplicitUserConversionExists (EmitContext
ec, Type source, Type target)
@@ -1270,7 +1256,7 @@
MethodGroupExpr mg = expr as
MethodGroupExpr;
if (mg != null)
return
ImplicitDelegateCreation.Create (
- ec, mg, target_type,
false, loc);
+ ec, mg, target_type,
loc);
}
}
Modified: trunk/mcs/gmcs/delegate.cs
===================================================================
--- trunk/mcs/gmcs/delegate.cs 2006-03-27 11:40:03 UTC (rev 58570)
+++ trunk/mcs/gmcs/delegate.cs 2006-03-27 12:22:08 UTC (rev 58571)
@@ -448,7 +448,7 @@
arg_count = args.Count;
Expression ml = Expression.MemberLookup (
- ec, delegate_type, "Invoke", loc);
+ ec.ContainerType, delegate_type, "Invoke", loc);
MethodGroupExpr me = ml as MethodGroupExpr;
if (me == null) {
@@ -488,7 +488,7 @@
public static bool VerifyDelegate (EmitContext ec, Type
delegate_type, Type probe_type, Location loc)
{
Expression ml = Expression.MemberLookup (
- ec, delegate_type, "Invoke", loc);
+ ec.ContainerType, delegate_type, "Invoke", loc);
if (!(ml is MethodGroupExpr)) {
Report.Error (-100, loc, "Internal error: could
not find Invoke method!");
@@ -499,7 +499,7 @@
ParameterData pd = TypeManager.GetParameterData (mb);
Expression probe_ml = Expression.MemberLookup (
- ec, delegate_type, "Invoke", loc);
+ ec.ContainerType, delegate_type, "Invoke", loc);
if (!(probe_ml is MethodGroupExpr)) {
Report.Error (-100, loc, "Internal error: could
not find Invoke method!");
@@ -617,7 +617,7 @@
protected MethodGroupExpr method_group;
protected Expression delegate_instance_expression;
- public DelegateCreation () {}
+ protected DelegateCreation () {}
public static void Error_NoMatchingMethodForDelegate
(EmitContext ec, MethodGroupExpr mg, Type type, Location loc)
{
@@ -668,7 +668,7 @@
protected bool ResolveConstructorMethod (EmitContext ec)
{
Expression ml = Expression.MemberLookup (
- ec, type, ".ctor", loc);
+ ec.ContainerType, type, ".ctor", loc);
if (!(ml is MethodGroupExpr)) {
Report.Error (-100, loc, "Internal error: Could
not find delegate constructor!");
@@ -689,19 +689,12 @@
return null;
}
- protected Expression ResolveMethodGroupExpr (EmitContext ec,
MethodGroupExpr mg,
- bool check_only)
+ protected Expression ResolveMethodGroupExpr (EmitContext ec,
MethodGroupExpr mg)
{
- foreach (MethodInfo mi in mg.Methods){
- delegate_method = Delegate.VerifyMethod
(ec.ContainerType, type, mg, mi, loc);
-
- if (delegate_method != null)
- break;
- }
-
+ delegate_method = ImplicitStandardConversionExists (mg,
type);
+
if (delegate_method == null) {
- if (!check_only)
- Error_NoMatchingMethodForDelegate (ec,
mg, type, loc);
+ Error_NoMatchingMethodForDelegate (ec, mg,
type, loc);
return null;
}
@@ -776,13 +769,13 @@
}
static public Expression Create (EmitContext ec,
MethodGroupExpr mge,
- Type target_type, bool
check_only, Location loc)
+ Type target_type, Location loc)
{
ImplicitDelegateCreation d = new
ImplicitDelegateCreation (target_type, loc);
- if (d.ResolveConstructorMethod (ec))
- return d.ResolveMethodGroupExpr (ec, mge,
check_only);
- else
+ if (!d.ResolveConstructorMethod (ec))
return null;
+
+ return d.ResolveMethodGroupExpr (ec, mge);
}
}
@@ -825,7 +818,7 @@
MethodGroupExpr mg = e as MethodGroupExpr;
if (mg != null)
- return ResolveMethodGroupExpr (ec, mg, false);
+ return ResolveMethodGroupExpr (ec, mg);
Type e_type = e.Type;
@@ -914,7 +907,7 @@
if (!Delegate.VerifyApplicability (ec, del_type,
Arguments, loc))
return null;
- Expression lookup = Expression.MemberLookup (ec,
del_type, "Invoke", loc);
+ Expression lookup = Expression.MemberLookup
(ec.ContainerType, del_type, "Invoke", loc);
if (!(lookup is MethodGroupExpr)) {
Report.Error (-100, loc, "Internal error: could
not find Invoke method!");
return null;
Modified: trunk/mcs/gmcs/ecore.cs
===================================================================
--- trunk/mcs/gmcs/ecore.cs 2006-03-27 11:40:03 UTC (rev 58570)
+++ trunk/mcs/gmcs/ecore.cs 2006-03-27 12:22:08 UTC (rev 58571)
@@ -676,10 +676,10 @@
BindingFlags.Static |
BindingFlags.Instance;
- public static Expression MemberLookup (EmitContext ec, Type
queried_type,
+ public static Expression MemberLookup (Type container_type,
Type queried_type,
string name, Location
loc)
{
- return MemberLookup (ec.ContainerType, null,
queried_type, name,
+ return MemberLookup (container_type, null,
queried_type, name,
AllMemberTypes, AllBindingFlags,
loc);
}
@@ -2133,7 +2133,7 @@
if (lookup_ds.TypeBuilder == null)
break;
- e = MemberLookup (ec, lookup_ds.TypeBuilder,
Name, loc);
+ e = MemberLookup (ec.ContainerType,
lookup_ds.TypeBuilder, Name, loc);
if (e != null)
break;
@@ -2146,7 +2146,7 @@
} while (lookup_ds != null);
if (e == null && ec.ContainerType != null)
- e = MemberLookup (ec, ec.ContainerType, Name,
loc);
+ e = MemberLookup (ec.ContainerType,
ec.ContainerType, Name, loc);
if (e == null) {
if (almost_matched == null &&
almostMatchedMembers.Count > 0) {
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches