Why don't all of these variables get treated the same way?
问题 I was checking that the position of variable declarations in VB.NET don't matter, except for scope, (for this question) and I thought I better check what happens when they're "lifted" into a closure. I haven't read the spec, but I can't explain these results: Dim outer As Integer For i = 1 To 2 Dim inner As Integer Try Dim inner2 As Integer Do Dim inner3 As Integer Call Sub() Dim inner4 As Integer Console.WriteLine(outer & ", " & inner & ", " & inner2 & ", " & inner3 & ", " & inner4) outer =