From 40b4d86c6ac36e143762eb280d80a64558b0d508 Mon Sep 17 00:00:00 2001 From: MIRIMIRIM <59959583+MIRIMIRIM@users.noreply.github.com> Date: Sun, 28 Jul 2024 15:07:15 +0800 Subject: [PATCH] Remove some NativeAOT warnings --- src/ZLogger/Internal/MagicalBox.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ZLogger/Internal/MagicalBox.cs b/src/ZLogger/Internal/MagicalBox.cs index c9299db..2bce803 100644 --- a/src/ZLogger/Internal/MagicalBox.cs +++ b/src/ZLogger/Internal/MagicalBox.cs @@ -371,7 +371,7 @@ sealed class Handlers( return false; } - static bool EnumStringWrite(MagicalBox box, int offset, ref DefaultInterpolatedStringHandler handler, int alignment, string? format) + static bool EnumStringWrite<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] T>(MagicalBox box, int offset, ref DefaultInterpolatedStringHandler handler, int alignment, string? format) { if (box.TryRead(offset, out var v)) { @@ -393,7 +393,7 @@ static bool EnumStringWrite(MagicalBox box, int offset, ref DefaultInterpolat return false; } - static bool EnumUtf8Write(MagicalBox box, int offset, ref Utf8StringWriter> writer, int alignment, string? format) + static bool EnumUtf8Write<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] T>(MagicalBox box, int offset, ref Utf8StringWriter> writer, int alignment, string? format) { if (box.TryRead(offset, out var v)) {