Enumerable extension methods resolution problem

SyntaxEditor .NET Languages Add-on for WPF Forum

Posted 7 years ago by Nicolas
Version: 12.2.0573
Platform: .NET 4.0
Environment: Windows 7 (64-bit)
Avatar

When using Enumerable (or Queryable) extensions methods, type resolution doesn't work very well.

For exemple, consider code :

using System;
using System.Collections.Generic;
using System.Linq;

class Test

{

IEnumerable<int> Data;

void Test()

{

var result = Data.Sum(i => i);

}

}

SyntaxEditor consider "result" variable as a "double?". Same code in Visual Studio consider "result" variable as an "int".

I'm using SyntaxEditor to generate code from lambda expression edited by user. It's very important for me that type resolution work fine.

Will this bug be solved quickly ?

Comments (1)

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Nicolas,

Thanks for the example.  This is a tricky scenario since there are many Sum overloads and a difference between many of them is the return type of the Func parameter.  We've updated our code to better handle this and properly return int in your example.  The change will be in the 2013.1 version, which should be out sometime in the next month.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.