Hello,

Hi,

I made a fix for this problem; the type for Finalize() is not
System.Object unless the type which is being added is System.Object.

Based on your patch I committed better fix.

Thanks,
Marek


Atsushi Eno

Raja R Harinath wrote:

Hi,

"Gert Driesen" <[EMAIL PROTECTED]> writes:


As of recently, I get the following warning (numerous times) when using mcs
svn to compile even the simplest app on Windows:


warning CS8028: The method 'System.Object.Finalize()' is marked 'override',
but
doesn't appear to override any virtual or abstract method: it may be ignored
dur
ing overload resolution
C:\cygwin\usr\local\lib\mono\1.0\mscorlib.dll: 'System.Object.Finalize'
(name of
symbol related to previous warning


Any idea what might be causing this ?



A method is marked with the 'Virtual' MethodAttribute, but doesn't have 'NewSlot' is treated as an "override" function. The C# compiler tries to find the underlying "virtual" function that it overrides. In some cases, it's unable to do so. We can't get into this situation when compiling C# code. So, this warning is typically issued when some dll was generated by SRE or written in IL.

However, it turns out that several compiler-generated functions are also
being marked this way.  It's the case with a delegates .Invoke () on
NET 1.1 and mono.

I suspect that CSC 1.1 also emits the .Finalize () function this way,
too.  I'll try to fix this soon.  However, I believe this warning is
harmless in this case, since Finalize cannot be invoked such that it
takes part in overload resolution.

- Hari
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


------------------------------------------------------------------------

Index: decl.cs
===================================================================
--- decl.cs (revision 43229)
+++ decl.cs (working copy)
@@ -1438,8 +1438,7 @@
//
if ((member.Name != "Invoke" ||
!type.IsSubclassOf (TypeManager.multicast_delegate_type)) &&
- (member.Name != "Finalize" ||
- type != TypeManager.object_type)) {
+ member.Name != "Finalize") {
Report.SymbolRelatedToPreviousError (base_method);
Report.Warning (-28, "The method '{0}' is marked 'override'," +



_______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to