In class/Microsoft.Build.Tasks/Microsoft.Build.Tasks:
[mcs.git] / tests / gtest-462.cs
blob32b9c1596021e16790ee105667901f4d0b18300b
1 using System;
3 class Program
5 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);