Say i want to do something like this
T1 GenericMethod<T1>(T2 arg)
where T1 : GenericClass<T2>
{
...
}
seems it isn't possible, i have to write like this
T1 GenericMethod<T1, T2>(T2 arg)
where T1 : GenericClass<T2>
{
...
}
So the question is, can i somehow make first sample work? (passing only one type parameter, the other must be automaticly calculated related to class'es parameter)
Yeah, and one more question, does boxing happen when i use type parameter with where TValue : ISomething, if i would call method from value (struct) type passed as type parameter? Or it is only a hint for compiler to use certain methods? I need to call method from value type, but i don't want boxing to be appeared