[Mono-bugs] [Bug 360455] New: gmcs erroneously raises "x is never used" warning

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Feb 10 22:00:57 EST 2008


           Summary: gmcs erroneously raises "x is never used" warning
           Product: Mono: Compilers
           Version: 1.9.0
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: abockover at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

If an event in a generic class of T whose delegate signature does not reference
T is defined, gmcs will erroneously warn that said event is never used.

For the attached test case, the following is the output of gmcs

aaron at wallabee:~/Desktop$ gmcs gmcs-invalid-warning.cs 
gmcs-invalid-warning.cs(7,31): warning CS0067: The event `TestGeneric<T>.Event'
is never used
Compilation succeeded - 1 warning(s)

I am noticing this in Banshee in a few places, for instance:


When compiling this file, gmcs says that the `Iteration' event is never used,
even though it clearly is (raised in `OnIteration').

I have not been able to test this absolutely on older gmcs releases, but I do
recall seeing the warning on 1.2.6 as well.

Also to note: the code works just fine at runtime - this seems only to be a
problem resolving when to warn in the compiler, so it's not severe at all, just
a bit annoying.

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list