Skip to content

Commit 5c02e0a

Browse files
committed
Convert back to abstract class
1 parent ce85a0b commit 5c02e0a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/DotNext/Runtime/BoxedValue.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,11 @@ namespace DotNext.Runtime;
2121
/// not for <see cref="BoxedValue{T}"/>.
2222
/// </remarks>
2323
/// <typeparam name="T">The value type.</typeparam>
24-
public class BoxedValue<T> // do not add any interfaces or base types
24+
public abstract class BoxedValue<T> // do not add any interfaces or base types
2525
where T : struct
2626
{
2727
internal T value;
2828

29-
[ExcludeFromCodeCoverage]
30-
private BoxedValue() => throw new NotImplementedException();
31-
3229
/// <summary>
3330
/// Gets a reference to the boxed value.
3431
/// </summary>
@@ -110,6 +107,15 @@ namespace DotNext.Runtime;
110107
/// <returns>Mutable reference to the boxed value.</returns>
111108
public static implicit operator ValueReference<T>(BoxedValue<T> boxedValue)
112109
=> new(boxedValue, ref boxedValue.value);
110+
111+
/// <inheritdoc />
112+
public abstract override bool Equals([NotNullWhen(true)] object? obj); // abstract to avoid inlining by AOT/JIT
113+
114+
/// <inheritdoc />
115+
public abstract override int GetHashCode(); // abstract to avoid inlining by AOT/JIT
116+
117+
/// <inheritdoc />
118+
public abstract override string ToString(); // abstract to avoid inlining by AOT/JIT
113119
}
114120

115121
public static class BoxedValue

0 commit comments

Comments
 (0)