You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using System;
using System.Collections.Generic;
public class Class1
{
public static void Main(string[] args)
{
Dictionary<Class1, Class1> state1 = new Dictionary<Class1, Class1>();
state1.Add(new Class1(), new Class1());
foreach (Class1 key in state1.Keys)
Console.Write(state1[key]);
Dictionary<Class1, Class1> state2 = state1.Copy();
foreach (Class1 key in state2.Keys)
Console.Write(state2[key]);//Exception
}
}
Occurs for all Dictionarys who use classes as key that do not override GetHashCode()
The text was updated successfully, but these errors were encountered:
Occurs for all Dictionarys who use classes as key that do not override GetHashCode()
The text was updated successfully, but these errors were encountered: