In class/Microsoft.Build.Tasks/Microsoft.Build.Tasks:
[mcs.git] / tests / gtest-anon-55.cs
blob92b8563caac2377049272e34bd7bf49b90543f65
1 using System;
3 public sealed class Thing<TFirst> where TFirst : class
5 public static Thing<TFirst> Create<TSecond> (Func<TFirst, TSecond> fn)
6 where TSecond : class
8 return new Thing<TFirst> (
9 delegate (TFirst item) {
10 TSecond foo = item == null ? null : fn (item);
11 Console.WriteLine (foo);
12 });
15 public void SomeAction ()
17 _fn (null);
20 private Thing (Action<TFirst> fn)
22 _fn = fn;
25 Action<TFirst> _fn;
28 public static class Program
30 public static void Main ()
32 var foo = Thing<object>.Create (x => x);
33 foo.SomeAction ();