Skip to content

fix: PolyType [TypeShape] attribute and disable NRTs for the marshaler#846

Merged
SteveDunn merged 4 commits intoSteveDunn:mainfrom
aradalvand:main
Oct 4, 2025
Merged

fix: PolyType [TypeShape] attribute and disable NRTs for the marshaler#846
SteveDunn merged 4 commits intoSteveDunn:mainfrom
aradalvand:main

Conversation

@aradalvand
Copy link
Contributor

@aradalvand aradalvand commented Sep 24, 2025

Please see AArnott/Nerdbank.MessagePack#651 — goes back to #835

This PR fixes two things:

  1. Currently, the PolyType integration doesn't even work with Nerdbank.MessagePack — and the culprit is Kind = TypeShapeKind.None within the [TypeShape] attribute. I removed that.
  2. The generated PolyType marshaler causes a whole bunch of nullability warnings wherever a [ValueObject]'s underlying type is a reference type (e.g. string) — I wrapped the marshaler class in a #nullable disable/#nullable restore pair of preprocessors.
image

I also made the marshaler class sealed to improve perf a little bit as well.

@aradalvand aradalvand changed the title fix: disable nullability for reference types within the scope of the generated PolyType marshaler fix: PolyType [TypeShape] attribute and disable NRTs for the marshaler Sep 24, 2025
@aradalvand
Copy link
Contributor Author

@SteveDunn Could you please take a look here Steve?

@aradalvand
Copy link
Contributor Author

Just updated the snapshot. The pipeline should pass now, hopefully.

@SteveDunn
Copy link
Owner

Hi - thank you for the PR. Would you mind resetting all of the snapshot files by running .\RunSnapshots.ps1 -v "minimal" -reset (and then go on a short holiday while it does its stuff! ;) )

@aradalvand
Copy link
Contributor Author

Thank you @SteveDunn — that helped. There was a missing parenthesis I needed to sort out.

@SteveDunn SteveDunn merged commit a48aa58 into SteveDunn:main Oct 4, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants