SteveDunn / Vogen

A semi-opinionated library which is a source generator and a code analyser. It Source generates Value Objects
Apache License 2.0
734 stars 41 forks source link

`InvalidCastException` in Vogen 4.0.3 #591

Closed viceroypenguin closed 2 months ago

viceroypenguin commented 2 months ago

Describe the bug

When editing code in a project in VS 17.9.4, a CS8785 is generated in visual studio. This exception is not reported on the command line.

image

Steps to reproduce

In a blank project with Vogen 4.0.3 referenced, use the following code:

[assembly: VogenDefaults(conversions: Conversions.Default)]

Console.WriteLine("Test");

[ValueObject]
public readonly partial record struct TestId;

Expected behaviour

There will be no compiler errors presented by Visual Studio.

SteveDunn commented 2 months ago

Thanks for the bug report. This duplicates #589 and will be fixed in v4.0.4