Author: martin
Date: 2005-04-19 14:00:01 -0400 (Tue, 19 Apr 2005)
New Revision: 43276
Modified:
trunk/mcs/gmcs/ChangeLog
trunk/mcs/gmcs/decl.cs
trunk/mcs/gmcs/iterators.cs
Log:
**** Merged r42902 from MCS ****
Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog 2005-04-19 17:55:36 UTC (rev 43275)
+++ trunk/mcs/gmcs/ChangeLog 2005-04-19 18:00:01 UTC (rev 43276)
@@ -1,5 +1,8 @@
2005-04-13 Raja R Harinath <[EMAIL PROTECTED]>
+ * decl.cs (MemberCache.AddMethods): Don't warn if
+ System.Object.Finalize has buggy MethodAttributes.
+
* typemanager.cs (IsUnmanagedType): Restore !IsValueType check
removed below.
Modified: trunk/mcs/gmcs/decl.cs
===================================================================
--- trunk/mcs/gmcs/decl.cs 2005-04-19 17:55:36 UTC (rev 43275)
+++ trunk/mcs/gmcs/decl.cs 2005-04-19 18:00:01 UTC (rev 43276)
@@ -1765,18 +1765,22 @@
method_hash.Add (name, list);
}
- if (member.IsVirtual &&
- (member.Attributes &
MethodAttributes.NewSlot) == 0) {
- MethodInfo base_method = ((MethodInfo)
member).GetBaseDefinition ();
+ MethodInfo curr = (MethodInfo) member;
+ while (curr.IsVirtual && (curr.Attributes &
MethodAttributes.NewSlot) == 0) {
+ MethodInfo base_method =
curr.GetBaseDefinition ();
- if (base_method == member) {
+ if (base_method == curr) {
//
// Both mcs and CSC 1.1 seem to
emit a somewhat broken
// ...Invoke () function for
delegates: it's missing a 'newslot'.
// CSC 2.0 emits a 'newslot'
for a delegate's Invoke.
//
- if (member.Name != "Invoke" ||
- !TypeManager.IsDelegateType
(type)) {
+ // Also, CSC 1.1 appears to
emit 'Finalize' without a newslot.
+ //
+ if ((member.Name != "Invoke" ||
+
!TypeManager.IsDelegateType (type)) &&
+ (member.Name != "Finalize"
||
+ type !=
TypeManager.object_type)) {
Report.SymbolRelatedToPreviousError (base_method);
Report.Warning (-28,
"The method
'{0}' is marked 'override'," +
@@ -1784,33 +1788,13 @@
" it may be
ignored during overload resolution",
TypeManager.CSharpSignature (base_method));
}
- goto skip;
- }
- for (;;) {
- list.Add (new CacheEntry (null,
base_method, MemberTypes.Method, bf));
- if ((base_method.Attributes &
MethodAttributes.NewSlot) != 0)
- break;
-
- //
- // Shouldn't get here. Mono
appears to be buggy.
- //
- MethodInfo new_base_method =
base_method.GetBaseDefinition ();
- if (new_base_method ==
base_method) {
-
Report.SymbolRelatedToPreviousError (base_method);
- Report.Warning (-28,
- "The method
'{0}' is marked 'override'," +
- " but doesn't
appear to overrided any virtual or abstract method:" +
- " it may be
ignored during overload resolution",
-
TypeManager.CSharpSignature (base_method));
- break;
- }
- base_method = new_base_method;
+ break;
}
-
-
+
+ list.Add (new CacheEntry (null,
base_method, MemberTypes.Method, bf));
+ curr = base_method;
}
- skip:
// Unfortunately, the elements returned by
Type.GetMethods() aren't
// sorted so we need to do this check for every
member.
Modified: trunk/mcs/gmcs/iterators.cs
===================================================================
--- trunk/mcs/gmcs/iterators.cs 2005-04-19 17:55:36 UTC (rev 43275)
+++ trunk/mcs/gmcs/iterators.cs 2005-04-19 18:00:01 UTC (rev 43276)
@@ -45,6 +45,8 @@
Report.Error (1625, loc, "Cannot yield in the
body of a " +
"finally clause");
return false;
+ } else {
+ Report.Debug ("Not in finally");
}
if (ec.InUnsafe) {
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches