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

HashTable.CopyTo not working as expected #401

Closed
MatthiasJentsch opened this issue Sep 3, 2018 · 2 comments · Fixed by nanoframework/CoreLibrary#23
Closed

HashTable.CopyTo not working as expected #401

MatthiasJentsch opened this issue Sep 3, 2018 · 2 comments · Fixed by nanoframework/CoreLibrary#23

Comments

@MatthiasJentsch
Copy link
Contributor

Details about Problem

nanoFramework area: nanoCLR preview 791

Worked before? No

Detailed repro steps so we can see the same problem

using System.Collections;

namespace NFApp1
{
	public class Program
	{
		public static void Main()
		{
			Hashtable theHashtable = new Hashtable();
			theHashtable.Add(2, 'n');
			theHashtable.Add(3, 'a');
			theHashtable.Add(5, 'n');
			theHashtable.Add(7, 'o');
			theHashtable.Add(11, 'F');
			theHashtable.Add(13, 'r');
			theHashtable.Add(17, 'a');
			theHashtable.Add(19, 'm');
			theHashtable.Add(23, 'e');
			theHashtable.Add(29, 'w');
			theHashtable.Add(31, 'o');
			theHashtable.Add(37, 'r');
			theHashtable.Add(41, 'k');

			object[] c = new object[15];
			theHashtable.CopyTo(c, 2);
		}
	}
}

The expected result should be that c[0] and c[1] are null, because we are copying at start index 2 in the destination array. But c[0] and c[1] are not null.

@NemesisXB
Copy link
Contributor

I'll fix this

@MatthiasJentsch
Copy link
Contributor Author

OK. @NemesisXB I've assigned the issue to you.

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

Successfully merging a pull request may close this issue.

3 participants