I wrote this code:
var (left, right) = A.FooWith(B);
where left
, right
, A
and B
are all T
s:
public class T {
// ...
public (T left, T right) FooWith(T other)
{
T left = new (GetInfoFrom(this, other));
T right = new (GetMoreInfoFrom(this, other));
return (left, right);
}
}
I know for sure that FooWith
has to return a non null tuple with non null fields. But the compiler does not seem to see this, and it tells me that left
is of type T?
, and triggers warning down the code.
Is there a way to pass this information and prevent these warnings?