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
I have no defined opinion for these topics, and only start this discussion to share info and thoughs.
Task in the method parameter list
Now ISG removes Task (and ValueTask) from the sync method parameter list. I'm not sure it is the best behavior. Remember, Tasks is bigger than async-await scope. Tasks was successfully used in net framework 4.0 era, without any async-await.
So, It looks reasonable to allow sync method to consume Task in its parameter list. Like the following:
Now, ISG will remove await _t; from the body of sync method.
I understand that it makes no sense to improve ISG again and again indefinitely, to cover all conceivable options. We need to stop at some place, so these cases may be out of the scope we want to support.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have no defined opinion for these topics, and only start this discussion to share info and thoughs.
Task in the method parameter list
Now ISG removes
Task
(andValueTask
) from the sync method parameter list. I'm not sure it is the best behavior. Remember,Task
s is bigger thanasync-await
scope.Task
s was successfully used in net framework 4.0 era, without anyasync-await
.So, It looks reasonable to allow sync method to consume
Task
in its parameter list. Like the following:May be some switch would be useful, I don't know.
awaiting Task
What if ISG will convert
await myTask
(wheremyTask
is a real task, a variable) tomyTask.Wait()
?Now, ISG will remove
await _t;
from the body of sync method.I understand that it makes no sense to improve ISG again and again indefinitely, to cover all conceivable options. We need to stop at some place, so these cases may be out of the scope we want to support.
Beta Was this translation helpful? Give feedback.
All reactions