Now, as a C # programmer, I know that generics are awesome. However, when working on some VB.NET, I found that the following does not cause a compiler error:
Dim instance As List(Of Integer) instance.Add(True)
Why is this? I know that you are not required to throw in VB.NET, but I would think that this kills the main reason for using generic security.
Edit: I do not have a strict mode option, since this was not a real programming exercise, I just theoretically look at VB.NET. This is a theoretical question, since I expected it to cause a compiler error even when the option is disabled, as a feature of generic types.
Fiona - myaccessible.website
source share