+4
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user