* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / tests / test-187.cs
1 //
2 // This test verifies that we resolve the source expression in a compound
3 // expression before we attempt to use it.
4 //
5 // The test also attempts 
6 //
7
8 using System.Collections.Specialized;
9
10 public class MyClass
11 {
12         public Container this [ string s ]
13         {
14                 get { return null; }
15                 set { ; }
16         }               
17 }
18
19
20 public class Container
21 {
22         public static Container operator + ( Container c, object o )
23         {
24                 return c;
25         }       
26 }
27
28 class D {
29         static void A (NameValueCollection n, MyClass m, object o)
30         {
31                 //
32                 // Tests that ";" is a StringLiteral, *and* it has been resolved.  Triggered
33                 // by indexers, as indexers trigger an OverloadResolve.
34                 //
35                 n ["a"] += ";";
36
37                 //
38                 // A different, but similar beast.  A bug existed in the compiler that
39                 // prevented the following from working (bug 36505)
40                 //
41                 m["apple"] += o;
42         }
43
44         
45         static int Main ()
46         {
47                 return 0;
48         }
49 }
50