Skip to content

Commit

Permalink
Run codegen.ps1 and fix compilation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Mar 11, 2023
1 parent 161cd19 commit 99ae5e1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
24 changes: 12 additions & 12 deletions sandbox/TestData2/Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,12 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::

public sealed class BFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::TestData2.B>
{
// a
private static global::System.ReadOnlySpan<byte> GetSpan_a() => new byte[1 + 1] { 161, 97 };
// ass
private static global::System.ReadOnlySpan<byte> GetSpan_ass() => new byte[1 + 3] { 163, 97, 115, 115 };
// c
private static global::System.ReadOnlySpan<byte> GetSpan_c() => new byte[1 + 1] { 161, 99 };
// a
private static global::System.ReadOnlySpan<byte> GetSpan_a() => new byte[1 + 1] { 161, 97 };

public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TestData2.B value, global::MessagePack.MessagePackSerializerOptions options)
{
Expand All @@ -272,12 +272,12 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::

var formatterResolver = options.Resolver;
writer.WriteMapHeader(3);
writer.WriteRaw(GetSpan_a());
writer.Write(value.a);
writer.WriteRaw(GetSpan_ass());
global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.Collections.Generic.List<global::TestData2.A>>(formatterResolver).Serialize(ref writer, value.ass, options);
writer.WriteRaw(GetSpan_c());
global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::TestData2.C>(formatterResolver).Serialize(ref writer, value.c, options);
writer.WriteRaw(GetSpan_a());
writer.Write(value.a);
}

public global::TestData2.B Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
Expand All @@ -301,22 +301,22 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::
FAIL:
reader.Skip();
continue;
case 3:
if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 7566177UL) { goto FAIL; }

____result.ass = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.Collections.Generic.List<global::TestData2.A>>(formatterResolver).Deserialize(ref reader, options);
continue;
case 1:
switch (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey))
{
default: goto FAIL;
case 97UL:
____result.a = reader.ReadInt32();
continue;
case 99UL:
____result.c = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::TestData2.C>(formatterResolver).Deserialize(ref reader, options);
continue;
case 97UL:
____result.a = reader.ReadInt32();
continue;
}
case 3:
if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 7566177UL) { goto FAIL; }

____result.ass = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.Collections.Generic.List<global::TestData2.A>>(formatterResolver).Deserialize(ref reader, options);
continue;

}
}
Expand Down
6 changes: 3 additions & 3 deletions sandbox/TestData2/NullableTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

using System;
// Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#pragma warning disable SA1307 // Accessible fields should begin with upper-case letter
#pragma warning disable SA1401 // Fields should be private
Expand All @@ -13,5 +13,5 @@ namespace TestData2;
public class NullableTest
{
public int[]? a;
public List<byte[]?> b;
public List<byte[]?> b = null!;
}

0 comments on commit 99ae5e1

Please sign in to comment.