We're hitting a regression when migrating our codebase from 2.16.6 to 3.3.3.
This is a minimal repro in C# that fails already at generation time:
using FsCheck;
using FsCheck.Fluent;
using FsCheck.Xunit;
namespace FsCheckRepro;
public abstract record Foo(string s);
public record Bar(string s, int n) : Foo(s);
public class Test
{
[Property]
public Property Prop(Bar message) => (message.s == (message as Foo)!.s).ToProperty();
}
Error: System.InvalidCastException : Unable to cast object of type 'System.Int32' to type 'System.String'.
We use a lot of Discriminated Unions in our codebase and rely on automatic generation of records. Writing all generators by hand for the derived records is possible, but tedious.
We're hitting a regression when migrating our codebase from 2.16.6 to 3.3.3.
This is a minimal repro in C# that fails already at generation time:
Error:
System.InvalidCastException : Unable to cast object of type 'System.Int32' to type 'System.String'.We use a lot of Discriminated Unions in our codebase and rely on automatic generation of records. Writing all generators by hand for the derived records is possible, but tedious.