`ArrayList` incorrect remarks

Open Beginner friendly
#12,797 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
78/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
csharp, powershell
Domain
documentation

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.

Description

area-System.Collections untriaged
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

$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

Dominant language
C#
Stars
950
Forks
1.7k
Avg merge
3d 5h
Merged PRs (30d)
38

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/dotnet-api-docs

All issues in dotnet/dotnet-api-docs

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.