dotnet / dotnet/dotnet-api-docs

Array.Resize underdocumented.

Open
#8,585 1 comment 0 reactions 0 assignees View on GitHub
area-System.Runtime Pri3 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

Array.Resize does not document behaviour in case of out-of-memory.

While a reasonable expectation could be it leaves the old array untouched and raise an exception, nothing of the kind is documented/promised in https://github.com/dotnet/dotnet-api-docs/blob/29b3cce4a0730de1c2473970535b7fbefabf6dce/xml/System/Array.xml#L6543.

Lacking such documentation, OOM is UB. That is not usable quality of an API contract.

Perhaps MS internal would also like a pointer to this issue, to investigate how this omission from API spec was even possible, how it could go unnoticed/unfixed for all this time, to prevent similar mistakes in the future.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.