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
_ = test switch{
test is ISomeInterface some =>await SomeMethodReturningTask(some),
test isISomeOtherInterface some =>await SomeMethodReturningTask(some),};
Would compile:
_ = test switch{
test is ISomeInterface some =>await TaskToUnitTask(SomeMethodReturningTask(some)),
test isISomeOtherInterface some =>await TaskToUnitTask(SomeMethodReturningTask(some)),};
This feature could simplify some code and allow usage of switch expressions with await even when the Task is non-generic.
Currently you'd have to do this, which really is annoying:
var someTask = test switch{
test is ISomeInterface some => SomeMethodReturningTask(some),
test isISomeOtherInterface some => SomeMethodReturningTask(some),};await someTask;
The text was updated successfully, but these errors were encountered:
Name idea: VoidTaskToUnitTask or TaskToUnitTask
practical usages:
does not compile:
Would compile:
This feature could simplify some code and allow usage of switch expressions with await even when the Task is non-generic.
Currently you'd have to do this, which really is annoying:
The text was updated successfully, but these errors were encountered: