diff --git a/AyCode.Core/Serializers/Binaries/AcBinarySerializer.cs b/AyCode.Core/Serializers/Binaries/AcBinarySerializer.cs index 37b14a7..803a1b2 100644 --- a/AyCode.Core/Serializers/Binaries/AcBinarySerializer.cs +++ b/AyCode.Core/Serializers/Binaries/AcBinarySerializer.cs @@ -470,14 +470,15 @@ public static partial class AcBinarySerializer #region Generated Writer Bridge Methods /// - /// Bridge for generated writers to call the runtime WriteValue for complex/collection properties. - /// Generated writers handle primitives directly; complex types delegate here. + /// Bridge for generated writers: writes a non-null complex/collection value directly. + /// Skips null check (caller handles it) and TryWritePrimitive (caller knows it's complex). + /// Equivalent to the runtime's WriteValueNonPrimitive path. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static void WriteValueGenerated(object? value, Type type, BinarySerializationContext context, int depth) + internal static void WriteValueGenerated(object value, Type type, BinarySerializationContext context, int depth) where TOutput : struct, IBinaryOutputBase { - WriteValue(value, type, context, depth); + WriteValueNonPrimitive(value, type, context, depth); } ///