Browse by Tags

Tagged Content List
  • Blog Post: Local variable scoping in C#

    In my previous post, Compiler-generated scopes for local variable declarations , I briefly touched on the issue of multiple meanings applied to the same name. In this post, I'll aim to flush out the compiler's rules with regards to binding names in their local scopes. Simple name resolution First, lets...
  • Blog Post: Compiler-generated scopes for local variable declarations

    I was tasked with understanding and fixing a bug on error reporting with foreach iteration variables the other day, and it got me thinking about local variable scoping rules in C# in general. First, the bug. The Bug Consider the following code: class C { static void Main( string [] args) { foreach (...
Page 1 of 1 (2 items)