A tricky workaround to achieve the same goal (detecting errors at compileTime) is to define small classes that do the trick to extend List for each type
The only disadvantage is that a class must be defined for each type (so it is not general) but can use them as a template for the next one just changing the object type.
Class CL_ListOfMyObjectType
Sub Class_Globals
Private mList as List
End Sub
Sub Initialize
mList.Initialize
End Sub
Sub Add(element as MyObjectClass)
mList.Add(element)
End Sub
Sub Get(index as Int) as MyObjectClass
return mList.Get(index)
End Sub
Sub Size As int
return mList.Size
End Sub
Sub GetList as List
return mList
End Sub
main code
Dim myListOfMyObjectType as CL_ListOfMyObjectType
myListOfMyObjectType.Initialize
Dim myObjectTypeInstance as MyObjectType
myListOfMyObjectType.Add(myObjectTypeInstance)