extensions rework pt1
.NET Test / .NET tests (push) Successful in 2m0s

This commit is contained in:
2026-07-13 22:20:47 +04:00
parent 46487a4794
commit 0e7986996f
30 changed files with 1476 additions and 160 deletions
+4 -4
View File
@@ -127,9 +127,9 @@ public readonly partial struct Result : IEquatable<Result>
[Pure] public override bool Equals(object? obj) => obj is Result other && Equals(other);
[Pure] public bool Equals(Result other)
{
if (State == ResultState.Bottom)
if (State == ResultState.Bottom || other.State == ResultState.Bottom)
throw new ResultNotInitializedException();
return Error == other.Error;
}
[Pure] public static bool operator ==(Result left, Result right) => left.Equals(right);
@@ -260,9 +260,9 @@ public readonly struct Result<T> : IEquatable<Result<T>>
[Pure] public override bool Equals(object? obj) => obj is Result<T> other && Equals(other);
[Pure] public bool Equals(Result<T> other)
{
if (State == ResultState.Bottom)
if (State == ResultState.Bottom || other.State == ResultState.Bottom)
throw new ResultNotInitializedException();
if (IsSuccess != other.IsSuccess)
return false;