-
-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Result.Try ambiguous invocation when using async statement lambdas since 3.11 #179
Comments
A similar issue in Xunit: xunit/xunit#2808 |
With C# 11 and beyond you can specify the lambda return type:
|
In xunit/xunit#2808, by recommendation from the Roslyn team, they removed all overloads that took a |
Interesting. Who used ValueTasks in combination with FluentResults? I will search for the inital issue to introduce these ValueTask methods and then we can make a decision. |
@altmann @saborrie this comment on #146 alludes to #143 which added |
Hello there, Even with await keyword before "Try" method, because this method is not asynch (pretty logical, though) Do you consider writing a "TryAsync", to make the compiler happy ? |
Before 3.11.0, these worked and compiled
but with 3.11.0 onwards I get a CS0121
I can of course just not do any async statement lambdas and put the code into dedicated methods but for me this feel a bit verbose and makes quick "try async thing inline" inside methods not so quick
instead of
Only 8 months too late with this feedback and honestly I wouldn't even have a good suggestion on how one would give ValueTask + Task support in overloads. I tried to think of any Microsoft written API that receive a Task and return a Task but couldn't think of anything similar.
Btw love your library
The text was updated successfully, but these errors were encountered: