I accidently wrote some code today that was like this:
Private Sub Foo()
Dim i as Nullable(Of Integer)
Bar(i)
End Sub
Private Sub Bar(myInt as Integer)
''//Do Stuff
End Sub
I immediately noticed the issue, but I had already hit the run button. It compiled successfully, I ran it through to the section and it threw an exception.
You can't do this in C#, it gives a compile error "cannot convert from 'int?' to 'int'".
Is there an 'Option Explicit' type switch that I can turn on to ensure that this sort of error does not occur again?