GeezerVison is showing github.com — Fixed nullable embedded types are being added to generated resolver by Scormave · Pull Request #1556 · MessagePack-CSharp/MessagePack-CSharp
Conversation
Scormave
commented
Jan 26, 2023
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
If some embedded reference type, such as byte[] is defined as nullable in MessagePackObject, it starts to appear in generated resolver. But, generated formatter for byte[] (ArrayFormatter) is not binary compatible with embedded formatter (ByteArrayFormatter).
This is what is generated from NullableTest before the fix:
static GeneratedResolverGetFormatterHelper()
{
lookup = new global::System.Collections.Generic.Dictionary<global::System.Type, int>(18)
{
{ typeof(byte[]), 0 },
{ typeof(global::System.Collections.Generic.List<byte[]>), 1 },
{ typeof(global::System.Collections.Generic.List<global::TestData2.A>), 2 },
{ typeof(global::System.Collections.Generic.List<global::TestData2.B>), 3 },
{ typeof(int[]), 4 },
{ typeof(global::TestData2.Nest1.Id), 5 },
{ typeof(global::TestData2.Nest2.Id), 6 },
{ typeof(global::TestData2.A), 7 },
{ typeof(global::TestData2.B), 8 },
{ typeof(global::TestData2.C), 9 },
{ typeof(global::TestData2.Nest1), 10 },
{ typeof(global::TestData2.Nest1.IdType), 11 },
{ typeof(global::TestData2.Nest2), 12 },
{ typeof(global::TestData2.Nest2.IdType), 13 },
{ typeof(global::TestData2.NullableTest), 14 },
{ typeof(global::TestData2.PropNameCheck1), 15 },
{ typeof(global::TestData2.PropNameCheck2), 16 },
{ typeof(global::TestData2.Record), 17 },
};
}
After the fix it looks like this:
static GeneratedResolverGetFormatterHelper()
{
lookup = new global::System.Collections.Generic.Dictionary<global::System.Type, int>(16)
{
{ typeof(global::System.Collections.Generic.List<byte[]>), 0 },
{ typeof(global::System.Collections.Generic.List<global::TestData2.A>), 1 },
{ typeof(global::System.Collections.Generic.List<global::TestData2.B>), 2 },
{ typeof(global::TestData2.Nest1.Id), 3 },
{ typeof(global::TestData2.Nest2.Id), 4 },
{ typeof(global::TestData2.A), 5 },
{ typeof(global::TestData2.B), 6 },
{ typeof(global::TestData2.C), 7 },
{ typeof(global::TestData2.Nest1), 8 },
{ typeof(global::TestData2.Nest1.IdType), 9 },
{ typeof(global::TestData2.Nest2), 10 },
{ typeof(global::TestData2.Nest2.IdType), 11 },
{ typeof(global::TestData2.NullableTest), 12 },
{ typeof(global::TestData2.PropNameCheck1), 13 },
{ typeof(global::TestData2.PropNameCheck2), 14 },
{ typeof(global::TestData2.Record), 15 },
};
}
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 26, 2025
This was referenced Dec 2, 2025
This was referenced Jan 22, 2026
This was referenced Jun 11, 2026
This was referenced Jun 11, 2026
This was referenced Jun 26, 2026
This was referenced Oct 19, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|