Ask Your Question
4

What is the reason for receiving a compilation error when attempting to utilize a record type in C#?

asked 2022-12-28 11:00:00 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-02-18 02:00:00 +0000

ladyg gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-12-28 11:00:00 +0000

Seen: 11 times

Last updated: Feb 18 '23