No Equals on interfaces
From: Michi Henning (michi_at_zeroc.com)
Date: 09/03/04
- Next message: Dennis D.: "Re: White Papers - VB.Net"
- Previous message: Norton: "Code Review Add ins for VS.Net"
- Next in thread: Tom Dacon: "Re: No Equals on interfaces"
- Reply: Tom Dacon: "Re: No Equals on interfaces"
- Reply: Herfried K. Wagner [MVP]: "Re: No Equals on interfaces"
- Reply: Jay B. Harlow [MVP - Outlook]: "Re: No Equals on interfaces"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 03 Sep 2004 14:20:38 +1000
Hi,
the following code won't compile, but I believe it should:
Interface X
End Interface
Module M
Sub Main(ByVal args As String())
Dim iref As X
iref.Equals(iref) ' 'Equals' is not a member of 'vb.I'.
End Sub
End Module
The compiler complains that X does not have a member Equals.
(The same complaint is issued for the other methods of System.Object:
GetHashCode, GetType, and ToString.)
This seems wrong, given that C# compiles the equivalent code
without complaint.
Also, the following works fine:
Dim iref As X
Dim oref As Object = iref
oref.Equals(oref)
Clearly, if there is an implicit conversion from X to Object,
then X must have the members of Object (otherwise, implicit
conversion would have to be illegal.)
Does anyone know whether this problem is fixed for Whidbey?
Thanks,
Michi.
- Next message: Dennis D.: "Re: White Papers - VB.Net"
- Previous message: Norton: "Code Review Add ins for VS.Net"
- Next in thread: Tom Dacon: "Re: No Equals on interfaces"
- Reply: Tom Dacon: "Re: No Equals on interfaces"
- Reply: Herfried K. Wagner [MVP]: "Re: No Equals on interfaces"
- Reply: Jay B. Harlow [MVP - Outlook]: "Re: No Equals on interfaces"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|