Cysharp / Cysharp/MemoryPack

MemoryPack generated unions don't work with nested interfaces

Open
#394 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
4.7k
Forks
313
PR merge metrics
No merged PRs in 30d

Description

The following gist shows a semi-complex hierarchy of nested interfaces and records:

https://gist.github.com/pixsperdavid/a1eda8c5742e9c712860d5a93a46cc9b

This fails to build as MemoryPack is generating a partial interface IV1 which is not enclosed in a partial nested interface, causing a duplicate definition.

As I added the nested classes support originally this is my oversight, working on a PR currently to address.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked gist to reproduce the nested interface and record hierarchy, then inspect the source-generator entry point that emits the partial IV1 interface. Verify the generated declarations preserve their enclosing nested interfaces and build without a duplicate definition.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.