Merge pull request #1861 from saper/home-override
[mono-project.git] / mcs / tests / gtest-462.cs
blob74bd6b743fd81c7e080844c03f4145003754babd
1 using System;
3 class Program
5 public static int Main ()
7 Tester<int> t = new Tester<int> ();
8 int r = t.Get (333);
9 Console.WriteLine (r);
10 if (r != 333)
11 return 1;
13 r = t.Get (222.12);
14 Console.WriteLine (r);
15 if (r != 0)
16 return 2;
18 return 0;
21 class Tester<T> where T : struct, IConvertible
23 public T Get (object data)
25 var val = data;
26 if (val is T)
27 return (T) val;
28 return default (T);