Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Records were introduced in C# 9.0 and are not available in earlier versions of C#. Therefore, if a C# program is compiled with an earlier version of the language, a compilation error will occur when attempting to utilize a record type. Additionally, records may also be subject to certain language limitations, such as not being able to inherit from classes or use certain attribute types, which may cause compilation errors if violated.