return 0;
}
- struct Pair<T1, T2> {
+ interface IConstrainedCalls {
+ Pair<int, int> vtype_ret<T, T2>(T t, T2 t2) where T: IReturnVType;
+ }
+
+ public interface IReturnVType {
+ Pair<int, int> return_vtype ();
+ }
+
+ public class CConstrainedCalls : IConstrainedCalls {
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public Pair<int, int> vtype_ret<T, T2>(T t, T2 t2) where T : IReturnVType {
+ return t.return_vtype ();
+ }
+ }
+
+ class ReturnVType : IReturnVType {
+ public Pair<int, int> return_vtype () {
+ return new Pair<int, int> () { First = 1, Second = 2 };
+ }
+ }
+
+ public static int test_0_constrained_vtype_ret () {
+ IConstrainedCalls c = new CConstrainedCalls ();
+ var r = c.vtype_ret<ReturnVType, int> (new ReturnVType (), 1);
+ if (r.First != 1 || r.Second != 2)
+ return 1;
+ return 0;
+ }
+
+ public struct Pair<T1, T2> {
public T1 First;
public T2 Second;
}