diff --git a/src/Error.cs b/src/Error.cs index 927ffc6..f19d149 100644 --- a/src/Error.cs +++ b/src/Error.cs @@ -5,7 +5,7 @@ namespace UnmanagedResult; -public readonly struct Error : IError +public readonly struct Error : ICodeError where TEnum : unmanaged, Enum { public TEnum Code { get; } diff --git a/src/ICodeError.cs b/src/ICodeError.cs new file mode 100644 index 0000000..ff5ba7e --- /dev/null +++ b/src/ICodeError.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2026 Viktor Stojanović. All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using System; + +namespace UnmanagedResult; + +public interface ICodeError : IError + where TEnum : unmanaged, Enum +{ + public TEnum Code { get; } +}