Comment on C# Hidden OptimizationsparentComments−yread15ywell you can write it as var f = ((x) => x + 1).Compile(); int b = f.Invoke(42);−oozcitak15yI don't think that would work. How would the compiler know the type of x and the return type of the lambda expression?−the_rara_avis15yIt won't. In just about all cases, C# doesn't do backtracking to infer types. See Eric Lippert's posts: http://blogs.msdn.com/b/ericlippert/archive/2010/10/04/no-ba...
Comments
well you can write it as
I don't think that would work. How would the compiler know the type of x and the return type of the lambda expression?
It won't. In just about all cases, C# doesn't do backtracking to infer types. See Eric Lippert's posts: http://blogs.msdn.com/b/ericlippert/archive/2010/10/04/no-ba...