Why can't lamdas infer types when an out
param is present?
#9597
-
If I want to pass something resembling a .TryParse() lamda into a method, then I have to define all the types on the lamda, in a way that I don't have to the rest of the time.
Obviously in that particular case I could have just passed the method group, rather than define a lamda, but if that isn't an option it's annoying 😁 I assume that there is in fact a reason; so I'm just curious about what it is that makes it necessary / makes allowing the "easier" option so hard? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I believe that is slated for C# 14 due out this fall: https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-14#simple-lambda-parameters-with-modifiers |
Beta Was this translation helpful? Give feedback.
-
@HaloFour FYI it isn't working in the preview currently Also, duplicate of #9522 |
Beta Was this translation helpful? Give feedback.
@HaloFour FYI it isn't working in the preview currently
Also, duplicate of #9522