Just playing around with some generics, and I'm getting one bit that I'm
not happy with. I thought I had this working, but I've changed something
and now it doesn't.
I have an interface
Interface IBase(Of T, E)
And a child interface
Interface ILevel1
And a Class
Class Level1
Implements ILevel1
Implements IBase(of string, integer)
Then I have a factory with a method as such
Function GetALevel(Of TLevel(Of T, E)() As IBase(Of T, E)
In another class, I want to call the following
Dim foo as Factory = new Factory
Dim bar as foo.GetALevel(Of ILevel1)()
I think that the type of T and E should be inferred from the ILevel
interface. I'm sure I had this working, then a made a number of changes
all around this code, then noticed it wasn't working anymore.
Can anyone explain this better?
Thanks
Clint Colefax