dotnet / dotnet/dotnet-api-docs
`ArrayList` incorrect remarks
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
### Type of issue
Other (describe below)
### Description
It says:
> Using multidimensional arrays as elements in an ArrayList collection is not supported.
This is factually false. Consider
```powershell
$al = [System.Collections.ArrayList]::new();
$al.Add([int[,]]::new(2, 2)) | Out-Null;
$al.GetType(); # ArrayList
$al[0].GetType(); # int[,]
$al; # four 0's
```
Did the author intend to mean
> If you add an array as an element to an ArrayList `al`, you cannot access the indexer of that array without casting, so `al[0][0]` doesn't work. You need to write `((int[,])al[0])[0, 0]` if `al[0]` is `int[,]`.
### Page URL
https://learn.microsoft.com/en-us/dotnet/api/system.collections.arraylist?view=net-10.0#remarks
### Content source URL
https://github.com/dotnet/dotnet-api-docs-temp/blob/live/xml/System.Collections/ArrayList.xml
### Document Version Independent Id
6a622c60-e7f9-3105-0b79-96b74ed08569
### Platform Id
8cf9e552-6fbf-c688-1a3c-ecf392888b8a
### Article author
@dotnet-bot
Contributor guide
Research direction
Open xml/System/ArrayList.xml from the content source URL and locate the ArrayList remarks containing the claim about multidimensional arrays. Compare that wording with the PowerShell example and the proposed clarification in the issue. Done means the inaccurate statement is corrected in the ArrayList remarks and the page accurately describes the indexing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100