You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bool Fizz(Func<int, bool> a) { return a(42); }
bool Fizz(Func<string, bool> a) { return a("42"); }
then Fizz(x => x=="a") is ok and valid and x inferred to be of type string and the second overload picked, but Fizz(x => true) cannot infer x; one must write Fizz( (string x) => true) since x can't be inferred - unless there's only one overload, in which case, it can be inferred.
None of this is implemented; ExpressionToCode simply assumes the type of x can always be inferred. ExpressionToCode should attempt to verify whether x's type can be inferred and if not, add types to all parameters of the lambda.
From eamon.nerbonne on February 03, 2011 10:02:14
Calling Fizz, with Fizz as:
then Fizz(x => x=="a") is ok and valid and x inferred to be of type string and the second overload picked, but Fizz(x => true) cannot infer x; one must write Fizz( (string x) => true) since x can't be inferred - unless there's only one overload, in which case, it can be inferred.
None of this is implemented; ExpressionToCode simply assumes the type of x can always be inferred. ExpressionToCode should attempt to verify whether x's type can be inferred and if not, add types to all parameters of the lambda.
Original issue: http://code.google.com/p/expressiontocode/issues/detail?id=14
The text was updated successfully, but these errors were encountered: