Unity-Technologies/unityscript2csharp

Do not emit lambda parameter types if C# compiler can infer them

Closed this issue · 0 comments

Given a method (in C#) like:

void M(Func<int, int> f) {}

The following UnityScript code

M( function (i) return i + 1);

is converted to:

M( (object i) => return i + 1);

Which is wrong.

Also in this case the C# compiler can infer the types of i, so instead we should convert it to:

M(  (i) => return i + 1);