Hi! Can you please help me here, why the compiler does not infer the lambda input parameter right?
Example:
void Test(Action<string> n)
{
}
void Test(Action<int,string> n)
{
}
Ok so when doing this:
obj.Test(x=>{}); // compiler doesn't know x is a string
If I do this:
obj.Test((x,y)=>{}); // that works, compiler know x is a int and y is a string
Looks like I will have to specify the input parameter type (?)
obj.Test((string x) => {}) // <-- Prefer not doing this
So any reasons why the compiler can't get the type right?
Thanks! Carlos