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 -2
View File
@@ -206,6 +206,7 @@ public sealed class ExpectedError : Error
{
public ExpectedError(string type, string message)
{
ArgumentNullException.ThrowIfNull(type);
Type = type;
Message = message;
}
@@ -252,6 +253,7 @@ public sealed class ExceptionalError : Error
public ExceptionalError(string type, string message)
{
ArgumentNullException.ThrowIfNull(type);
Type = type;
Message = message;
}
@@ -343,7 +345,7 @@ public sealed class ManyErrors : Error, IEnumerable<Error>, IReadOnlyList<Error>
[Pure] public override string Type => "many_errors";
private string? _lazyMessage = null;
[Pure] public override string Message => _lazyMessage ??= ToFullArrayString(_errors);
[Pure] public override string Message => _lazyMessage ??= ToFullArrayString(_errors); // not thread safe. wontfix
[Pure] private static string ToFullArrayString(in ImmutableArray<Error> errors)
{
@@ -428,7 +430,7 @@ public sealed class ManyErrors : Error, IEnumerable<Error>, IReadOnlyList<Error>
}
private int? _lazyHashCode = null;
[Pure] public override int GetHashCode() => _lazyHashCode ??= CalcHashCode(_errors);
[Pure] public override int GetHashCode() => _lazyHashCode ??= CalcHashCode(_errors); // not thread safe. wontfix
private static int CalcHashCode(in ImmutableArray<Error> errors)
{
if (errors.IsEmpty)