VS 2008 is out the door!

On December 19th, we officially announced that VS 2008 is released to manufacturing! This is the first release of the product (of any product for that matter) that I’ve worked heavily on, so I’m quite anxious to see the feedback on the work that we’ve done. Aside from the obvious LINQ work that we’ve created…


Virtual Events in C#

Technorati Tags: Events One of the things that the language designers considered when designing the C# language was the ability to notify external callers of certain events happening. To solve this problem, they (surprise surprise) introduced the event construct. One of the oddities in the design however, comes in the form of virtual events. This…


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 recall the spec’s definition of simple…


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 (int myCollection in myCollection) {…


Another compiler dev

Hi there. My name is Sam Ng, and I’m a developer on the C# compiler team. This here’s my little outlet of random stuff that I think about, and things that I learn as I dig deeper into the wonderful world of software. Who am I? I’m currently a developer on the C# compiler team….