[mcs] Allow properties and indexers of by-ref values to be set without setter
[mono.git] / mcs / tests / test-212.cs
1 //
2 // A compilation test - params with implicit user conversion
3 //
4
5 class Problem {
6         string somedata;
7
8         public Problem(string somedata) {
9                 this.somedata = somedata;
10         }
11         public static implicit operator Problem(int x) {
12                 return new Problem("" + x);
13         }
14
15         public static int Multi(int first, params Problem[] rest) {
16                 return rest.Length;
17         }
18
19         public static int Main(string[] args) {
20                 Problem[] ps = new Problem[] { 1, 2, 3 }; // ok
21                 Multi (1, 2, 3, 4); // fails to compile
22
23                 return 0;
24         }
25 }