diff --git a/src/ResultObject/Result.Constructor.cs b/src/ResultObject/Result.Constructor.cs index e0d8e62..57d3c85 100755 --- a/src/ResultObject/Result.Constructor.cs +++ b/src/ResultObject/Result.Constructor.cs @@ -124,7 +124,7 @@ public static Result Success(TValue value) where TValue : notnul /// } /// /// - public static Result Failure(ResultError error) + public static Result Failure(ResultError error) where TValue : notnull => new(default, error); /// diff --git a/src/ResultObject/ResultError.cs b/src/ResultObject/ResultError.cs index b29871b..90a01e1 100755 --- a/src/ResultObject/ResultError.cs +++ b/src/ResultObject/ResultError.cs @@ -7,7 +7,7 @@ public abstract record ResultErrorBase( string Code, string Reason, string Message, - ResultError? InnerError, + ResultErrorBase? InnerError, string? StackTrace ) { @@ -104,7 +104,7 @@ public record ResultError( string Reason, string Message, TErrorCategory? Category = null, - ResultError? InnerError = null, + ResultErrorBase? InnerError = null, string? StackTrace = null) : ResultErrorBase(Code, Reason, Message, InnerError, StackTrace) where TErrorCategory : struct, Enum { @@ -188,7 +188,7 @@ public record ResultError( string Reason, string Message, ErrorCategory? Category = null, - ResultError? InnerError = null, + ResultErrorBase? InnerError = null, string? StackTrace = null) : ResultError(Code, Reason, Message, Category, InnerError, StackTrace) { diff --git a/src/ResultObject/ResultObject.csproj b/src/ResultObject/ResultObject.csproj index 50caa2e..7e7fd99 100755 --- a/src/ResultObject/ResultObject.csproj +++ b/src/ResultObject/ResultObject.csproj @@ -7,7 +7,7 @@ .Net ResultObject ResultObject - 1.1.2 + 1.1.3 Ahmed Kamal A robust Result type for .NET with built-in error categorization, supporting type-safe success/failure scenarios without exceptions. MIT