Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BitArray.CopyTo(array, index) doesn't respect index - .NET Core 3.0 Preview 8 #3194

Closed
danielValdezR opened this issue Aug 15, 2019 · 2 comments · Fixed by dotnet/corefx#40441

Comments

@danielValdezR
Copy link

BitArray CopyTo(Array, Int32) doesn't respect index

When using CopyTo method, the index passed as parameter is not respected and the BitArray is copied at the end of the Array. I found this issue when using a Byte array.

General

Console Project
.NET Core 3.0 Preview 8
Windows 10 Pro x64

byte[] byteArray = new byte[10];
BitArray bitArray = new BitArray(1);
bitArray[0] = true;

bitArray.CopyTo(byteArray, 5);

Expected: 1 in position 5 of byteArray
Actual: 1 at the end of the byteArray

Tested against past versions of .NET Core (.NET Core 2.X) and worked as `expected.```

@danielValdezR danielValdezR changed the title copyto BitArray.CopyTo(array, index) doesn't respect index Aug 15, 2019
@danielValdezR danielValdezR changed the title BitArray.CopyTo(array, index) doesn't respect index BitArray.CopyTo(array, index) doesn't respect index - .NET Core 3.0 Preview 8 Aug 15, 2019
@0xd4d
Copy link

0xd4d commented Aug 15, 2019

It's probably better to post this bug report to the corefx repo: https://github.com/dotnet/corefx

@danielValdezR
Copy link
Author

There's an issue already open in dotnet/corefx...
https://github.com/dotnet/corefx/issues/39929

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant