[jit] Fix the saving of the 'cfg->ret_var_set' flag when inlining, it was set to...
[mono.git] / mcs / tests / gtest-var-04.cs
1
2 // Tests variable type inference with the var keyword when using the foreach statement with generic collections
3 using System;
4 using System.Collections.Generic;
5
6 public class Test
7 {
8         public static int Main ()
9         {
10                 string[] strings = new string[] { "Foo", "Bar", "Baz" };
11                 
12                 foreach (var v in strings)
13                         if (v.GetType () != typeof (string))
14                                 return 1;
15                         
16                 Dictionary<int, string> dict = new Dictionary<int, string> ();
17                 dict.Add (0, "boo");
18                 dict.Add (1, "far");
19                 dict.Add (2, "faz");
20                 
21                 foreach (var v in dict)
22                         if (v.GetType () != typeof (KeyValuePair<int, string>))
23                                 return 2;
24                 
25                 return 0;
26         }
27 }