Has someone a hint what I'm doing wrong in VB.Net?
Module Module1
Interface ISearch(Of T As ISearchResult)
Function ids() As List(Of T)
End Interface
Interface ISearchResult
Function id() As String
End Interface
MustInherit Class BasicSearch(Of T As ISearchResult)
Implements ISearch(Of T)
MustOverride Function ids() As System.Collections.Generic.List(Of T) Implements ISearch(Of T).ids
End Class
Class Search
Inherits BasicSearch(Of SearchResult)
Implements ISearch(Of SearchResult)
Overrides Function ids() As System.Collections.Generic.List(Of SearchResult)
Return New List(Of SearchResult)
End Function
End Class
Class SearchResult
Implements ISearchResult
Public Function id() As String Implements ISearchResult.id
Return "id"
End Function
End Class
Sub Main()
Dim foo As New Search()
Dim bar As Object = foo
Dim foobar As ISearch(Of ISearchResult) = foo
End Sub
End Module
The third cast isn't working. Why?
did I miss a oop lesson?
thanks