How to reproduce:
- Open the attached "IN-156893" project
- In the menu bar, select "Tools" > "Bug Repros" > "C385 SRP ResizeArray NativeArray"
- Observe the Console
Actual result: "ArgumentException" is thrown, and the array still has 10 elements
Expected result: The array has 5 elements
Reproducible with: 6000.0.0f1, 6000.7.0b6, 7000.0.0a11
Reproducible on: Windows 10 (by user), Windows 11
Not reproducible on: No other environments tested
Workaround: Allocate the new NativeArray yourself, copy Math.Min(array.Length, capacity) elements, and dispose the old array. This copies only the elements that fit