1 // Compiler options: -r:test-543-lib.dll
7 public int this[params bool[] args
] { get { return 2; }
}
8 public string this[bool a
, object b
] { get { throw new NotImplementedException (); }
}
13 public int this [int expectedLength
, params string[] items
]
17 if (expectedLength
!= items
.Length
)
18 throw new ArgumentException (expectedLength
+ " != " + items
.Length
);
22 public object this [int expectedLength
, params object[] items
]
26 if (expectedLength
!= items
.Length
)
27 throw new ArgumentException (expectedLength
+ " != " + items
.Length
);
31 public bool this [int expectedLength
, bool isNull
, params object[] items
]
35 if (expectedLength
!= items
.Length
)
36 throw new ArgumentException (expectedLength
+ " != " + items
.Length
);
40 public static void Main(string[] args
)
42 MainClass t
= new MainClass();
43 t
[2, "foo", "doo"] = 2;
44 t
[3, new object[3]] = null;
45 t
[2, new int[] { 1 }
, new string[] { "c", "b", "a" }
] = null;
46 t
[0, true] = t
[0, true];
47 t
[1, false, "foo"] = t
[0, false, "foo", "doo"];
49 ExternClass e
= new ExternClass ();
50 e
["a", "b", "b"] = false;
52 BetterMethod bm
= new BetterMethod ();
53 Console
.WriteLine (bm
[true, false]);