I noticed some strange behavior and I can't find an answer online:
Visual Studio 2013, both option explicit and option strict are set to On and Option Infer is set to Off. While I'm required to specify a type for any variable I declare I noticed that I don't have to declare a variable type in a For Each loop so this doesn't throw an error or a warning:
For Each dtRow in objTable.Rows
Next
If I hover over dtRow it's defined as Object. This is code I inherited and tasked with cleaning up. I already checked to verify that dtRow isn't declared somewhere global by searching the code as well as trying to assign to dtRow outside the For Each loop as well as creating a new For Each loop with a gibberish variable name and it throws no error.
But, in Visual Studio 2012 this functions as expected. I get an error telling me that dtRow is not declared. I can replicate this behavior in any project in VS 2013.
Is this a new feature for VS 2013 or a known issue? Can anybody else replicate this?
Thanks
Chris