IHandle(of ...) is ambiguous

Topics: Bugs
Mar 20, 2013 at 11:57 PM
When I have multiple IHandle I'm receiving this warning:

'Interface 'caliburn.mciro.ihandle(of events.detailchangedevent)' is ambiguous with another implmeneted interface 'caliburn.miro.ihandle(of events.modelsavedevent)' due to the 'In' and 'Out' parameters in 'Interface IHandle(Of In TMessage)'

I'm using VB, VS 2012, .net 4.5, and CM 1.5. The previous version of CM did not give me those warnings.
Mar 21, 2013 at 8:41 AM
This can only happen when your events are in in inheritance hierarchy.
e.g. events.modelsavedevent is a subclass of events.detailchangedevent
Mar 21, 2013 at 4:17 PM
Edited Mar 21, 2013 at 4:17 PM
But they are not. My events are:
Namespace Events
    Public Class DetailChangedEvent
        Public Property Sender As Object
        Public Property Identification As Integer
    End Class
End Namespace
Namespace Events
    Public Class ModelSavedEvent
        Public Property Model as Object
    End Class
End Namespace
The source for IHandle has changed to include the "In" keyword. I don't see the value of adding that keyword, but if I remove the "In", I do not get the warnings.
Mar 21, 2013 at 4:32 PM
Seems that the VB.Net and the C# compiler behave different here:
Mar 21, 2013 at 5:12 PM
Yes, I have read the first link prior, but the short answer seems to be "oh well." I will have to take some time to read through the second link, but while skimming it I did not see an answer to how I should deal with these warnings.
  1. Is there a way to disable warnings with some like #IgnoreWarning, or some way in the project properties to ignore this specific warning?
  2. Is the "In" keyword really necessary in the source? Especially given this issue for VB users.
  3. Is there any other work around that I can do to make these warnings go away? (I'm going to try to create my own IHandle(Of Message), but I don't like that as a permanent solution.)
Mar 21, 2013 at 8:58 PM
Removed contravariance in latest source to fix this warnings.
Mar 21, 2013 at 9:30 PM