You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a variant class has no default constructor and all other constructors initialize the _variant field to a non-default value then the variant cannot be empty. Under these circumstances the "empty" case is impossible to achieve and can be removed from the interface as these code paths will never execute.
Possible conflict: if constructors are later changed and the empty state becomes possible the previously safe methods could now throw InvalidOperationException. Maybe keeping the empty state is the safer option as it reminds the user of this eventuality. This needs investigating.
The text was updated successfully, but these errors were encountered:
If a variant
class
has no default constructor and all other constructors initialize the_variant
field to a non-default value then the variant cannot be empty. Under these circumstances the "empty" case is impossible to achieve and can be removed from the interface as these code paths will never execute.Possible conflict: if constructors are later changed and the empty state becomes possible the previously safe methods could now throw
InvalidOperationException
. Maybe keeping the empty state is the safer option as it reminds the user of this eventuality. This needs investigating.The text was updated successfully, but these errors were encountered: