Cysharp / MasterMemory

Embedded Typed Readonly In-Memory Document Database for .NET and Unity.
MIT License
1.52k stars 110 forks source link

Uncompilable code generated #81

Closed robertmircea closed 7 months ago

robertmircea commented 1 year ago

The following code is not compilable when using the following code to initialize and query MasterMemory under .NET 7:


using MasterMemory;
using MasterMemoryDemo;
using MessagePack;

var builder = new DatabaseBuilder();
byte[] data = builder.Build();

// -----------------------

var db = new MemoryDatabase(data);

[MemoryTable("PortedMsisdns"), MessagePackObject(true)]
public class MsisdnInfo
{
    [PrimaryKey]
    public string Msisdn { get; set; }
    public string Operator { get; set; }
}

The error message from the compiler is

  MemoryDatabase.cs(32, 33): [CS0115] 'MemoryDatabase.Init(Dictionary<string, (int offset, int count)>, ReadOnlyMemory<byte>, MessagePackSerializerOptions)': no suitable method found to override
  MemoryDatabase.cs(16, 24): [CS0534] 'MemoryDatabase' does not implement inherited abstract member 'MemoryDatabaseBase.Init(Dictionary<string, (int offset, int count)>, ReadOnlyMemory<byte>, MessagePackSerializerOptions, int)'
daleholborow commented 1 year ago

Can confirm - the method Init is generated but is missing the degrees of parallelism method parameter, so

I can manually edit the MemoryDatabase class but of course the changes are discarded on every build, so I am somewhat stuck and unable to proceed.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] commented 8 months ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days.