I have a utility class that takes a general list as a parameter.
The code looks like this:
Function DoStuff(collection as Object, elt as Object)
...
collection.Add(elt)
...
End Function
Called with:
DoStuff( List(Of Foo), new Foo() )
DoStuff( List(Of Bar), new Bar() )
There are about a dozen different types.
Passing the Object currently leads to a late restriction warning, although it works fine.
I tried different methods of transferring to collections and elt (Foo and Bar extend the base class), but it seems they cannot determine the “correct” way to do this.
Ideas?
chris source
share