zzzprojects / Eval-Expression.NET

C# Eval Expression | Evaluate, Compile, and Execute C# code and expression at runtime.
https://eval-expression.net/
Other
459 stars 86 forks source link

The Enumerable.Intersect seems doesn't work for IEnumberable<char> #117

Closed ceastld closed 2 years ago

ceastld commented 3 years ago

The following statement will report an error.

using Z.Expressions;

namespace ConsoleApp1
{
    internal class Program
    {
        static void Main(string[] args)
        {
            var context = new EvalContext();
            context.Execute(@"'aaa'.Intersect('a');");
        }
    }
}

The error is as follows

image

Z.Expressions.Compiler.Shared.EvalException:“Oops! No applicable member has been found for the expression. The error occurred for expression "." at position 5 near ".Intersect('a');".”

but the Intersect method works for List<string>

JonathanMagnan commented 3 years ago

Hello @dyliu02 ,

Thank you for reporting, we can successfully reproduce it with your code and we will look at it.

Best Regards,

Jon

JonathanMagnan commented 3 years ago

Hello @dyliu02 ,

The v4.0.63 has been released.

Could you test it and let us know if methods now work correctly with IEnumerable<char> interface like in this case?

Best Regards,

Jon

ceastld commented 2 years ago

Ok, I tested it, and it works correctly now.

Thank you @JonathanMagnan