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
error CS1510: A ref or out value must be an assignable variable
That seems to be covered by the existing wording:
12.9.8.3 Classification of await expressions
The expression await t is classified the same way as the expression (t).GetAwaiter().GetResult(). Thus, if the return type of GetResult is void, the await_expression is classified as nothing. If it has a non-void return type T, the await_expression is classified as a value of type T.
GetResult here returns int by reference, but the await_expression is classified as a value. So the compiler works as specified. Still, it might be good to add a note about this case.
The text was updated successfully, but these errors were encountered:
I was playing with this code in SharpLab:
The
ref await
syntax causes an error:That seems to be covered by the existing wording:
GetResult here returns
int
by reference, but the await_expression is classified as a value. So the compiler works as specified. Still, it might be good to add a note about this case.The text was updated successfully, but these errors were encountered: