Is there any way I can get the compiler to accept this kind of generic type
upcasting at runtime?
Paul
Public Class GenericClass(Of SomeType As {New})
End Class
Public Sub Test()
Dim foo As New GenericClass(Of Integer)
Dim bar As GenericClass(Of Object) = DirectCast(Dire ctCast(foo,
Object), GenericClass(Of Object))
End Sub
upcasting at runtime?
Paul
Public Class GenericClass(Of SomeType As {New})
End Class
Public Sub Test()
Dim foo As New GenericClass(Of Integer)
Dim bar As GenericClass(Of Object) = DirectCast(Dire ctCast(foo,
Object), GenericClass(Of Object))
End Sub