1 using System
.Collections
.Generic
;
3 // comment this line to see another bug in gmcs (unrelated)
4 interface IB { bool foo (); }
7 class B
: IB { public bool foo () { return true; }
}
9 interface Filter
<T
> where T
: IB
{
15 public bool foo () { return false; }
19 class MyFilter
: Filter
<K
> {
20 public K
Is (IB x
) { return new K(); }
23 class MyBFilter
: Filter
<B
> {
24 public B
Is (IB x
) { return new B(); }
29 static List
<T
> foo1
<T
> (Filter
<T
> x
) where T
: IB
{
30 List
<T
> result
= new List
<T
>();
31 T maybe
= x
.Is (new B());
38 MyFilter m
= new MyFilter ();
39 System
.Console
.WriteLine (foo1
<K
> (m
).Count
);
40 MyBFilter mb
= new MyBFilter ();
41 System
.Console
.WriteLine (foo1
<B
> (mb
).Count
);