Repository navigation
Document open generic derived type support - #1073
Merged
Merged
Conversation
Keep the closed-generic example and add a simple open-generic union example for PolyType 1.4.1. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues remain.
Pull request overview
Updates polymorphic serialization documentation and samples to demonstrate open generic derived type support in PolyType 1.4.1.
Changes:
- Adds a
Base<T>/Derived<T>open-generic sample. - Documents type-argument inference and registration behavior.
File summaries
| File | Description |
|---|---|
samples/cs/Unions.cs |
Adds the open-generic union example. |
docfx/docs/unions.md |
Documents open generic derived type support. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1073 +/- ##
=======================================
Coverage 76.68% 76.68%
=======================================
Files 175 175
Lines 13477 13477
Branches 2727 2727
=======================================
Hits 10335 10335
Misses 2261 2261
Partials 881 881
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AArnott
approved these changes
Sep 17, 2026
This was referenced Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The polymorphic serialization docs still say generic derived types must be closed, although PolyType 1.4.1 supports open generic registrations.
Corrects that restriction and adds a simple
Base<T>/Derived<T>example adapted from eiriktsarpalis/PolyType#446. The original closed-generic example is unchanged.