'var' keyword type inference in conjunction with 'foreach'

SyntaxEditor .NET Languages Add-on for Windows Forms Forum

Posted 15 years ago by Brett Muir
Version: 4.0.0280

There's a language parsing feature that would make a great improvement for us, and I'm wondering if it's likely to be included in any future release. It seems like you've solved some related and more difficult problems in recent releases, so maybe you're planning to implement the feature I'd like!

If I type the following, I get full intellisense:

string[] strings;

foreach(string s in strings) {
   s.    // <- full intellisense here
However, if I type the following, I only get intellisense for "object" (ie, ToString(), GetHashCode(), etc)

string[] strings;

foreach(var s in strings) {
   s.    // <- I wish I could get full intellisense for type "string" here!!
In our application, the type that we are enumerating is not "string", but a more complex type (with a complex type name), and it would be great if we didn't require the user to have to specify our complex type name.

I'm currently using build

Best regards

Comments (1)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Brett,

We'll get this added to the TODO list, thanks.

Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.