'C# Init setters don't work on class records

I'm trying to use the init setters on a regular record, and they don't seem to work. But when I add the word "struct" to make it a record struct it works fine. Is this intended? It seems weird.

It doesn't seem to be a visual glitch because the build fails because of it, and restarting visual studio makes no difference. Adding empty brackets also doesn't help.

Error when using record's init setters



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source