SteveDunn / Vogen

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

`InvalidCastException` in Vogen 4.0.3 #591

Closed viceroypenguin closed 6 months ago

viceroypenguin commented 6 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 6 months ago

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