GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Adjusted MsgPack004 to support records by N-Olbert · Pull Request #1946 · MessagePack-CSharp/MessagePack-CSharp

Conversation

@N-Olbert

@N-Olbert N-Olbert commented Sep 4, 2024 •
edited by AArnott
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Merging #1932 from master to develop to fix #1924 in v3.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@N-Olbert
First merging attempt
58e869b
@N-Olbert

N-Olbert commented Sep 4, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@AArnott, have there been any changes or decisions regarding records with primary constructors? The second merged test flags a MsgPack007 for the record that has what I believe is a valid primary constructor. Is this intended behavior or a bug?

I annotated this in the source.

I will proceed based on your response.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

N-Olbert
N-Olbert commented Sep 4, 2024
View reviewed changes
Comment thread tests/MessagePack.SourceGenerator.Tests/MessagePackAnalyzerTests.cs Outdated
{
string input = Preamble + /* lang=c#-test */ @"
[MessagePackObject]
public record {|MsgPack007:Foo|}(

@N-Olbert N-Olbert Sep 4, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AArnott : Here

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@N-Olbert N-Olbert Sep 4, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a false-positive for records (but a correct one for normal classes, since the semantics of a „class“- primary ctor are different)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@AArnott AArnott Sep 25, 2024

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the test as you have it here. Primary constructors for records convert parameters to properties and thus should be serialized. Primary constructors on classes do not convert their parameters to properties and thus should not be serialized. That appears to be what you're asserting here, and all the tests pass, so I'm satisfied. Thank you.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
N-Olbert added 2 commits September 11, 2024 20:10
@N-Olbert
Merge / Fix: Support record primary constructor
c2e66be
@N-Olbert
Fix: Remove wrong diagnostics
58c2711
@N-Olbert

N-Olbert commented Sep 11, 2024

Copy link
Copy Markdown
Contributor Author

I merged the contents of the original PR. However, I believe that MsgPack007 is incorrect for records (but not for classes). If that’s the case, I can provide a fix in another PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@N-Olbert
N-Olbert marked this pull request as ready for review September 11, 2024 18:17
@AArnott AArnott changed the title Merging #1932 Adjusted MsgPack004 to support records Sep 25, 2024
@AArnott AArnott added this to the v3.0 milestone Sep 25, 2024
@AArnott AArnott added the analyzer label Sep 25, 2024
AArnott added 2 commits September 25, 2024 09:39
@AArnott
Adjust C# test string indentation for new tests
0f3f51e
@AArnott
Add tests for record struct types
72551a9
AArnott
AArnott approved these changes Sep 25, 2024
View reviewed changes

@AArnott AArnott left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tests/MessagePack.SourceGenerator.Tests/MessagePackAnalyzerTests.cs Outdated
{
string input = Preamble + /* lang=c#-test */ @"
[MessagePackObject]
public record {|MsgPack007:Foo|}(

@AArnott AArnott Sep 25, 2024

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the test as you have it here. Primary constructors for records convert parameters to properties and thus should be serialized. Primary constructors on classes do not convert their parameters to properties and thus should not be serialized. That appears to be what you're asserting here, and all the tests pass, so I'm satisfied. Thank you.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@AArnott
AArnott enabled auto-merge September 25, 2024 15:45
@AArnott
AArnott disabled auto-merge September 25, 2024 16:05
@AArnott
AArnott enabled auto-merge September 25, 2024 16:05
@AArnott
AArnott disabled auto-merge September 25, 2024 16:05
@AArnott
AArnott merged commit c7584c5 into MessagePack-CSharp:develop Sep 25, 2024
AArnott added a commit that referenced this pull request Sep 25, 2024
@AArnott
Merge commit 'fc3cada6ca' into mergeMasterToDevelop
9a2ab0d
This merge adds no content because the change in question was already brought in by #1946.
@dependabot dependabot Bot mentioned this pull request Jul 21, 2025
Bump BenchmarkDotNet and 18 others haga-rak/fluxzy.core#439
Closed
This was referenced Aug 4, 2025
Bump Amazon.Lambda.AspNetCoreServer and 31 others exceptionless/Exceptionless.Net#341
Closed
Bump Akka and 8 others akkadotnet/Akka.Persistence.Redis#425
Open
Bump MessagePack from 2.5.187 to 3.1.4 akkadotnet/Akka.Persistence.Redis#429
Open
@dependabot dependabot Bot mentioned this pull request Sep 19, 2025
Bump MessagePack from 2.6.100-alpha to 3.0.300 Revolutionary-Games/Arch.Extended#1
Closed
This was referenced Nov 3, 2025
⬆️ Bump MessagePack from 2.5.187 to 3.1.4 eugenecp/setlist-studio#74
Merged
deps: Bump MessagePack and MessagePack.Annotations msbolton/Conduit#10
Open
deps: Bump MessagePack.Annotations from 2.5.187 to 3.1.4 msbolton/Conduit#11
Open
@dependabot dependabot Bot mentioned this pull request Nov 10, 2025
Bump MessagePack from 2.5.198 to 3.1.4 lucaspimentel/MockTraceAgent#3
Closed
This was referenced Dec 2, 2025
Bump MessagePack from 2.3.85 to 3.1.4 dbolin/Apex.Serialization#262
Closed
Bump MessagePack and MessagePack.ImmutableCollection dbolin/Apex.Serialization#263
Open
This was referenced Nov 9, 2026
Bump MessagePack from 2.5.303 to 3.1.12 Franchef/Pifeon#5
Merged
Bump AWSSDK.S3 and 16 others PauloVianaR/ViverAppWeb#25
Closed
Bump the dotnet-dependencies group with 17 updates PauloVianaR/ViverAppWeb#26
Closed
Bump the nuget-major group with 9 updates Tjeerd-menno/nats-manager-ui#380
Closed
chore: Bump the nuget-updates group with 2 updates w1ck3ds0d4/GrainWallet#1
Closed
Bump the nuget group with 17 updates NikiforovAll/adaptive-rate-limiting-dotnet#16
Closed
Bump the nuget group with 1 update TanmayS0406/SSMSClaude-Script#14
Closed
deps: Bump MessagePack from 2.5.307 to 3.1.12 RMBarros-Dev/Hydra-Digital-Shop#14
Closed
Bump Avalonia and 11 others jeremychn/amarre#8
Closed
Bump the dotnet-major group with 8 updates chelomama-dev/finances-hub#32
Open
deps: Bump MessagePack from 2.5.307 to 3.1.12 erikdarlingdata/PerformanceStudio#715
Closed
This was referenced Nov 16, 2026
Bump AWSSDK.S3 and 16 others PauloVianaR/ViverAppWeb#27
Closed
Bump the dotnet-dependencies group with 17 updates PauloVianaR/ViverAppWeb#28
Open
Bump MessagePack from 2.5.307 to 3.1.12 afernandes/DiscoveryDeviceAndroid#5
Open
Bump MessagePack from 2.5.307 to 3.1.12 ErikEJ/SqlServer.Rules#820
Closed
Bump MessagePack from 2.5.307 to 3.1.12 thekim1/kalla#837
Closed
Bump the nuget-major group with 9 updates Tjeerd-menno/nats-manager-ui#386
Closed
Bump MessagePack from 2.5.307 to 3.1.12 jonnymuir/Heliograph#34
Closed
Bump AWSSDK.S3 and 15 others PauloVianaR/ViverAppWeb#30
Open
Bump the nuget-shipped group with 2 updates alexFinn97/scaffolder-for-optimizely#8
Closed
Bump the nuget group with 17 updates NikiforovAll/adaptive-rate-limiting-dotnet#17
Closed
Bump MessagePack from 2.5.307 to 3.1.12 Tjeerd-menno/nats-manager-ui#398
Merged
Bump the nuget group with 3 updates TanmayS0406/SSMSClaude-Script#17
Open
Bump MessagePack and 7 others chelomama-dev/finances-hub#34
Open
This was referenced Nov 23, 2026
Bump AWSSDK.S3 and 15 others PauloVianaR/ViverAppWeb#32
Closed
Bump the dotnet-dependencies group with 16 updates PauloVianaR/ViverAppWeb#33
Open
Bump MessagePack from 2.5.303 to 3.1.12 mortenbrudvik/Obfy#43
Closed
deps: Bump the "weekly" group with 1 update across multiple ecosystems ftichy/MiniShop#192
Merged
Bump MessagePack from 2.5.303 to 3.1.12 D-WIS/DWIS-Blackboard-Tests#45
Open
Bump the nuget group with 17 updates NikiforovAll/adaptive-rate-limiting-dotnet#18
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AArnott AArnott AArnott approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

analyzer

Projects

None yet

Milestone

v3.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@N-Olbert @AArnott
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.