blog community

Welcome to blog community Sign in | Join | Help
in Search

Wouter van Vugt

This blog is no longer maintained and has moved

Help, my C# 2.0 compiler is broken!

During my C# class of today I noticed something strange with the C# compiler. Take the following piece of code:

public class Test
{
 public Test()
  : this(“Test”)
 {
 }

 public Test(string someParam)
  : this()
 {
 }
}

This actually compiles! I believe the C# 1.1 compiler checked for circular initializer lists like you see above, the 2.0 compiler doesn’t however.
No biggy, when you write this kind of code, you belong on the daily WTF anyway :)

Published Wednesday, August 16, 2006 6:48 PM by wouterv
Filed under: ,

Comments

No Comments
Anonymous comments are disabled

This Blog

Syndication

News


Add to Technorati Favorites
Powered by Community Server, by Telligent Systems