Compiler 1 - Intellisense 0

by alski 10. April 2008 08:42
string result = i++.ToString();

Looks weird doesn't it, and yet it is a perfectly valid expression. The ++ operator returns the incremented value, and the .ToString() converts it. It even compiles.

Unfortunately Intellisense doesn't handle it. Nor does it work for

(i++).ToString();

However with enough hinting (ok its a blatant cast) you can get it to work.

((int) (i++)).ToString();

But that's damn ugly, and possibly requires a runtime cast to occur. (Have to check this out)

 

Technorati Tags: ,

PS. The spelling checker in LiveWriter believes that Intellisense should be Intelligence, I beg to differ. :)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Code | VisualStudio

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

RecentComments

Comment RSS