2 using System
.Reflection
;
7 static bool Check (Type t
)
9 Console
.WriteLine ($"--- {t}");
11 var m
= t
.GetMethod ("M1");
12 Console
.WriteLine (m
);
14 foreach(var p
in m
.GetParameters ())
15 Console
.WriteLine ($"{p}: {p.ParameterType} / {p.GetRequiredCustomModifiers().Length}");
18 return m
.GetParameters()[0].GetRequiredCustomModifiers().Length
== 1;
21 static int Main(string[] args
)
23 if (!Check (typeof (C
<>)))
25 if (!Check (typeof (C
<S1
>)))
29 int res
= o
.M1 (new S1 ());
30 Console
.WriteLine (res
);
33 Console
.WriteLine ("All good");
39 public abstract int M1
<T
>(in T arg
) where T
: U
, I1
;
44 public override int M1
<T2
> (in T2 arg
)
46 Console
.WriteLine ("C<S1>::M1");
63 Console
.WriteLine ("S1:M3");
68 Console
.WriteLine ("S1:M4 {0}", field
);