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 one side is Never, then the value will never be that side, so .value could always return the other.
If both sides are Never, then .value would then naturally return Never, which fits in perfectly.
it could be implemented like this:
publicextensionEitherwhere Left ==Never{varvalue:Right{
switch self{case.left:preconditionFailure("`Never` should not be reachable")case.right(let right):return right
}}}publicextensionEitherwhere Right ==Never{varvalue:Left{
switch self{case.right:preconditionFailure("`Never` should not be reachable")case.left(let left):return left
}}}
The text was updated successfully, but these errors were encountered:
If one side is
Never
, then the value will never be that side, so.value
could always return the other.If both sides are
Never
, then.value
would then naturally returnNever
, which fits in perfectly.it could be implemented like this:
The text was updated successfully, but these errors were encountered: