I have a class with the deconstructor:
public void Deconstruct(out bool isSuccess, out TSuccess? value, out Error? error) {...}
Value of isSuccess defines whish of value or error is null.
Can I somehow let compiler know about this, so when I call:
var (isSuccess, value, error) = result;
analyzer knows which variable can and cannot be null?
According to my knowledge you can't.
The
NotNullWhenAttributepostcondition relies on the boolean return value. For example:Since deconstructor must be defined in the way that its return type is
void, you can't mix the two techniques.