Merge pull request #5439 from alexrp/master
[mono.git] / mcs / tests / gtest-etree-10.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq.Expressions;
4
5 class Foo<T>
6 {
7         public bool ContainsAll<U> (IEnumerable<U> items) where U : T
8         {
9                 foreach (U item in items) {
10                         Expression<Func<bool>> e = () => !Contains (item);
11                         if (!e.Compile () ())
12                                 return false;
13                 }
14
15                 return true;
16         }
17
18         public bool Contains (T t)
19         {
20                 return false;
21         }
22 }
23
24 class Program
25 {
26         public static int Main ()
27         {
28                 var x = new Foo<int> ();
29                 return x.ContainsAll (new [] { 4, 6, 78 }) ? 0 : 1;
30         }
31 }
32