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
It should be possible to return a Task<string!> for a Task<string?>.
usingSystem.Threading.Tasks;
#nullable enable
publicclassC{publicTask<(boolResult,string?Extras)>M(){returnTask.FromResult((true,""));// currently produces a warning}}
Task<T>
nullability covarianceSummary
Task<T>
nullability covariance (LDM tentatively approved, needs design proposal for task-like types)It should be possible to return a
Task<string!>
for aTask<string?>
.Design meetings
Split issue from #3868
https://github.com/dotnet/csharplang/blob/main/meetings/2022/LDM-2022-09-28.md#nullability-improvements
https://github.com/dotnet/csharplang/blob/main/meetings/2024/LDM-2024-09-06.md#taskt-nullability-covariance
The text was updated successfully, but these errors were encountered: