Skip to content

Commit

Permalink
Suppress some buggy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
monoman committed Jan 23, 2024
1 parent f30f782 commit 04b6e52
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions InterlockLedger.Commons/Interfaces/System/ITextual.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public interface ITextual
string FullRepresentation => IsInvalid ? TextualRepresentation + Environment.NewLine + InvalidityCause! : TextualRepresentation;
}

#pragma warning disable CA1000 // Do not declare static members on generic types
public interface ITextual<TSelf> : ITextual, IEquatable<TSelf> where TSelf : ITextual<TSelf>
{
public ITextual<TSelf> Textual { get; }
Expand Down
1 change: 1 addition & 0 deletions InterlockLedger.Commons/Types/System/PageOf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

namespace System;

#pragma warning disable CA1000 // Do not declare static members on generic types
public record PageOf<T>(IEnumerable<T> Items, ushort Page, byte PageSize, ushort TotalNumberOfPages, bool LastToFirst)
{
public PageOf(IEnumerable<T> items, bool lastToFirst) : this(items.Required(), 0, 0, (ushort)(items.SafeAny() ? 1 : 0), lastToFirst) {
Expand Down
2 changes: 2 additions & 0 deletions InterlockLedger.Commons/Types/System/Result.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public Error(string errorMessage, int errorType = IError.DefaultErrorType) : bas
ErrorMessage = errorMessage;
}

#pragma warning disable CA1000 // Do not declare static members on generic types
public class Result<T> : Result
{
public static implicit operator T?(Result<T> r) => r.Required().Value;
Expand All @@ -101,6 +102,7 @@ public Error(Exception error, int errorType = IError.DefaultErrorType) : base(er
Exception = error;
ErrorMessage = Exception?.Message ?? string.Empty;
}

public Error(string? errorMessage, int errorType = IError.DefaultErrorType) : base(errorType) =>
ErrorMessage = errorMessage ?? string.Empty;

Expand Down

0 comments on commit 04b6e52

Please sign in to comment.