Cysharp / Cysharp/MemoryPack

Question: why List<int> property causes error: object containing type(s) must be partial?

Open
#428 3 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

using System;
using System.Collections.Generic;
using MemoryPack;

public class Program
{
	public static void Main()
	{
		var person = new Person();
		var bin = MemoryPackSerializer.Serialize(person);
	}

	[MemoryPackable]
	public partial class Person
	{
		public  List<int> IntItems { get; set; }
		public List<string> StringItems { get; set; }
	}
}

error MEMPACK042: The MemoryPackable object 'Person' containing type(s) must be partial

the docs says int, string, List<> are supported

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 minimal C# reproduction in the issue and reproduce diagnostic MEMPACK042 for the MemoryPackable Person containing List and List properties. Trace the diagnostic's handling of these property types and compare it with the documented supported types; done means the behavior or its explanation is consistent with the docs.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.