public string[] this[myStruct? x] { get { Target.Status = 3; return new string[] { } ; } set { Target.Status = 4; } }
public static int MainMethod(string[] args) { dynamic d = new Target(); myStruct s = new myStruct() { Ok = false } ; string[] ss = d[s]; if (ss[0] != "foo" || Target.Status != 1) return 1; d[s] = ss; if (Target.Status != 2) return 1; return 0; }
public string[] this[myStruct x] { get { Target.Status = 1; return new string[] { "foo" } ; } set { if (value[0] == "foo") Target.Status = 2; } }