Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow pointer types for record parameters #4077

Merged
merged 2 commits into from
Oct 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion proposals/csharp-9.0/records.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ an accessible concrete non-virtual member with a "matching" signature is inherit
Two members are considered matching if they have the same
signature or would be considered "hiding" in an inheritance scenario.
It is an error for a member of a record to be named "Clone".
It is an error for an instance field of a record to have an unsafe type.

The synthesized members are as follows:

Expand Down Expand Up @@ -365,7 +366,9 @@ of the `record_base` clause and within initializers of instance fields or proper
be an error in these locations (similar to how instance members are in scope in regular constructor initializers
today, but an error to use), but the parameters of the primary constructor would be in scope and useable and
would shadow members. Static members would also be useable, similar to how base calls and initializers work in
ordinary constructors today.
ordinary constructors today.

A warning is produced is a parameter of the primary constructor is not read.

Expression variables declared in the `argument_list` are in scope within the `argument_list`. The same shadowing
rules as within an argument list of a regular constructor initializer apply.
Expand Down