Resolver fail to detect invalid method call

SyntaxEditor .NET Languages Add-on for WPF Forum

Posted 6 years ago by Nicolas
Version: 13.2.0590
Environment: Windows 7 (64-bit)
Avatar

Considering a class "MyClass" having a string member "MyStringField".

The C# code below is invalid because method Sum<T>(Func<T,string>) doesn't exist.

IEnumerable<MyClass> myCollection;

var result = myCollection.Sum(myClassInstance => myClassInstance.MyStringField)

But the SyntaxEditor C# resolver say that "Sum" correspond to the extension method Enumerable.Sum<MyClass>(Func<MyClass,int>) and that variable "result" is of type "int" !?!

Comments (1)

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

Hi Nicolas,

If it fails to find an overload with the exact parameter types it will fall back and assume you mean another overload with the same method name, but with the closest available parameters.  That is by design.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) 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.