Bug description
Attempting to create custom IMessagePackFormatter for [Silk.NET]'s vector type results in compilation failure and Visual Studio 2022 crashing.
Repro steps
- Create new
net8.0 console project
- Include
MessagePack version 3.1.3
- Include
Silk.NET.Maths version 2.22.0
- Define type:
public sealed partial class Vector3DFormatter : IMessagePackFormatter<Vector3D<float>>
{
public Vector3D<float> Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options)
{
var x = reader.ReadSingle();
var y = reader.ReadSingle();
var z = reader.ReadSingle();
return new(x, y, z);
}
public void Serialize(ref MessagePackWriter writer, Vector3D<float> value, MessagePackSerializerOptions options)
{
writer.Write(value.X);
writer.Write(value.Y);
writer.Write(value.Z);
}
}
[assembly: MessagePack.MessagePackKnownFormatter(typeof(Vec3Formatter))]
- Try define MessagePack Object:
[MessagePackObject]
public sealed record Foo
{
[Key(0)]
public required Vec3<float> Position { get; init; }
}
Expected behavior
No errors/crashes.
Actual behavior
Visual Studio stops responding after a few seconds, before restarting itself (sometimes after all features disable themselves).
When building the project using dotnet build, the compilation fails.
- Version used:
3.1.3
- Runtime:
net8.0
Additional context
Copying the source code of Vector3D<T> into the local project and using that version has the same results. I am currently trying to find the exact part of the type definition that results in this behaviour.
Bug description
Attempting to create custom
IMessagePackFormatterfor [Silk.NET]'s vector type results in compilation failure and Visual Studio 2022 crashing.Repro steps
net8.0console projectMessagePackversion3.1.3Silk.NET.Mathsversion2.22.0Expected behavior
No errors/crashes.
Actual behavior
Visual Studio stops responding after a few seconds, before restarting itself (sometimes after all features disable themselves).
When building the project using
dotnet build, the compilation fails.3.1.3net8.0Additional context
Copying the source code of
Vector3D<T>into the local project and using that version has the same results. I am currently trying to find the exact part of the type definition that results in this behaviour.