A method that has the following characteristics cannot detour:
An instance method that has the parameter of the type as same as declaring type excluding this parameter.
A static method that has the parameter of the type as same as declaring type.
For example, the following method is that:
public class C<Bar>
{
public void Fuga(C<Bar> result)
{
throw new InvalidOperationException("We shouldn't get here!!");
}
}
In the managed code, we cannot make the generic type instance that is instantiated by its generic parameter. For example, typeof(Nullable<>).MakeGenericType(typeof(Nullable<>).GetGenericArguments()[0]) is treated same as Nullable<>.
A method that has the following characteristics cannot detour:
this
parameter.For example, the following method is that:
In the managed code, we cannot make the generic type instance that is instantiated by its generic parameter. For example,
typeof(Nullable<>).MakeGenericType(typeof(Nullable<>).GetGenericArguments()[0])
is treated same asNullable<>
.Against
this
parameter, we have already treated in such way. We should apply the way to all parameters.