[ilasm] Don't break arguments compatiblity
[mono-project.git] / mcs / tests / test-dictinit-02.cs
blobecd59dac1e08062d3f471dbb5707202e19afd5bf
1 using System;
2 using System.Collections.Generic;
4 class Program
6 static int Main ()
8 var c = new C {
9 ["l1"] = new C {
10 ["l2"] = new C () {
11 Value = 10
14 ["l5"] = {
15 ["51"] = new C () {
16 Value = 100
21 if (c ["l1"]["l2"].Value != 10)
22 return 1;
24 if (c ["l5"]["51"].Value != 100)
25 return 2;
27 return 0;
32 class C
34 public Dictionary<string, C> Dict = new Dictionary<string, C> ();
36 public int Value;
38 public C this [string arg] {
39 get {
40 C c;
41 if (!Dict.TryGetValue (arg, out c)) {
42 c = new C ();
43 Dict [arg] = c;
46 return c;
48 set {
49 Dict [arg] = value;