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
{{ message }}
This repository has been archived by the owner on May 16, 2022. It is now read-only.
The following throws an exception under .Net 5 / C# 9:
class Person
{
public Person() { }
public Person(int age, string name, Person[] data)
{
Age = age;
Name = name;
Data = data;
}
public int Age { get; set; }
public string Name { get; set; }
public Person[] Data { get; set; }
}
private void Test()
{
var p = new Person(99, "acrobat", new Person[]
{
new Person(1, "abc", null),
new Person(2, "xyz", null)
});
p = new Person(99, "acrobat", new Person[]
{
new Person(1, "abc", new Person[] { p }),
new Person(2, "xyz", null)
});
// throws exception
var result = JsonSerializer.Serialize(p);
var p2 = JsonSerializer.Deserialize<Person>(result);
}
The text was updated successfully, but these errors were encountered:
The following throws an exception under .Net 5 / C# 9:
The text was updated successfully, but these errors were encountered: