Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / gtest-527.cs
1 public static class CoalescingWithGenericsBug
2 {
3         class Service { public void Foo () { } }
4
5         static T Provide<T> () where T : class
6         {
7                 return FindExisting<T> () ?? System.Activator.CreateInstance<T> ();
8         }
9
10         static T FindExisting<T> () where T : class
11         {
12                 return null;
13         }
14
15         public static int Main ()
16         {
17                 Provide<Service> ().Foo ();
18                 return 0;
19         }
20 }