[Mono-dev] Bug #360455
Leszek Ciesielski
skolima at gmail.com
Thu May 21 05:44:43 EDT 2009
On Thu, May 21, 2009 at 11:41 AM, Marek Safar <marek.safar at seznam.cz> wrote:
> Hello Stefan,
>> I've been trying to fix https://bugzilla.novell.com/show_bug.cgi?id=360455.
>>
>> "(g)mcs erroneously raises "x is never used" warning CS0067 with public events"
>>
>> This happens when the containing class is generic but the event does not use the
>> generic type in it's signature. Therre is another test case that
>> reproduces the bug
>> without generics but contains a class with an abstract event and a derived class
>> implementing and using it. Here the warning is uttered erroneously, too.
>>
> Please attach your test case to the bug report.
I believe he is refering to the test cases already attached.
>
>> I looked into the mcs code but I could not quite find out, what's
>> going on here, though.
>> I believe the interesting part may be that one:
>>
>> ecore.cs: line 5651, constructor of EventExpr class
>>
>> public EventExpr (EventInfo ei, Location loc)
>> {
>> EventInfo = ei;
>>
>> // uninteresting code here
>>
>> if (EventInfo is MyEventBuilder){
>> MyEventBuilder eb = (MyEventBuilder) EventInfo;
>> type = eb.EventType;
>> eb.SetUsed (); // here the event is
>> flagged as used
>> } else
>> type = EventInfo.EventHandlerType;
>> }
>>
> It's possible but I won't be sure until I see your test case.
More information about the Mono-devel-list
mailing list