blob: 0a0209b5a3d518600c69388060b545f3d903c978 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
using System;
interface I
{
// int this [int i] { get; }
int[] this [params int[] ii] { get; }
}
class X : I {
public int this [int i] {
get { return i; }
}
public int[] this [params int[] ii] {
get { return new int[] { this[1], this[2], this[ii.Length] }; }
}
public static void Main ()
{
X x = new X ();
Console.WriteLine (x [1]);
int[] r = x [2, 2, 1, 2, 0];
for (int i = 0; i < r.Length; i++)
Console.Write (r [i] + " ");
Console.WriteLine ();
}
}
|