i made a custom Dictionary
but when i try to set some value i got error
StackOverflowException: The requested operation caused a stack overflow.
i dont get error on getter only the setter
let me share my code
public class myClass : Dictionary<object, object>
{
public myClass () { }
public myClass (int x) { }
public object this[object key] { get { return this[key]; } set { this[key] = value; } }
public object Clone() {
return new Dictionary<object, object>(this);
}
public IEnumerator<DictionaryEntry> GetEnumerator() {
return this.GetEnumerator();
}
}
data i tried to set to my class
myClass properties = new myClass ();
properties ["235"] = "www";
i don't see any StackOverflowException in the setter how did this value make StackOverflow?