blob: ea42c7591bbc424494aa2c00df2b09566a93f2b2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
using System;
public class GenericType<U, V> where U : IEquatable<U> where V : IEquatable<V>
{
public U u;
}
public class Base<V> where V : IEquatable<V>
{
public virtual T Test<T> (GenericType<T, V> gt) where T : IEquatable<T>
{
return gt.u;
}
}
public class Override<W> : Base<W> where W : IEquatable<W>
{
public override T Test<T> (GenericType<T, W> gt)
{
return base.Test (gt);
}
}
class M
{
public static int Main ()
{
Base<byte> b = new Override<byte> ();
b.Test (new GenericType<int, byte> ());
return 0;
}
}
|