Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / gtest-200.cs
1 class Test
2 {
3
4  public static T QueryInterface<T>(object val)
5    where T : class
6  {
7      if (val == null)
8          return null;
9
10      // First, see if the given object can be directly cast
11      // to the requested type.  This will be a common case,
12      // especially when checking for standard behavior interface
13      // implementations (like IXrcDataElement).
14      T tval = val as T;
15      if (tval != null)
16          return tval;
17
18      // ... rest of method unimportant and omitted ...
19      return null;
20  }
21 }
22
23 class Driver
24 {
25  public static void Main () {}
26 }
27