Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / gtest-anontype-06.cs
1
2
3 // "cast by example" test
4
5 class CastByExample
6 {
7         public static void Main()
8         {
9                 object o = new { Foo = "Data" };
10                 // Cast object to anonymous type
11                 var typed = Cast(o, new { Foo = "" });
12         }
13
14         static T Cast<T>(object obj, T type)
15         {
16                 return (T)obj;
17         }
18 }