You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the recursive depth safe mechanism doesn't work on records.
Generating an instance of this record as follows
public record FakeChild (string Name, List<FakeChild>? C);
var child = new AutoFaker<FakeChild>().Configure(x => x.WithTreeDepth(1).WithRecursiveDepth(1)).Generate();
will cause a StackOverflow exception.
The only way around this is to move the Children property to the Record body as follows:
public record FakeChild (string Name)
{
List<FakeChild> Children { get; set; }
}
While that works, it defies the purpose of using a Record instead of a Class.
The text was updated successfully, but these errors were encountered:
It seems that the recursive depth safe mechanism doesn't work on records.
Generating an instance of this record as follows
will cause a StackOverflow exception.
The only way around this is to move the
Children
property to the Record body as follows:While that works, it defies the purpose of using a Record instead of a Class.
The text was updated successfully, but these errors were encountered: