Allow record's parameter_list
to be empty. (#3900)
* Allow record's `parameter_list` to be empty. Based on https://github.com/dotnet/csharplang/blob/master/meetings/2020/LDM-2020-08-24.md#base-calls-on-parameterless-records
This commit is contained in:
parent
3882702804
commit
a87af899c0
|
@ -27,7 +27,6 @@ record_body
|
|||
Record types are reference types, similar to a class declaration. It is an error for a record to provide
|
||||
a `record_base` `argument_list` if the `record_declaration` does not contain a `parameter_list`.
|
||||
At most one partial type declaration of a partial record may provide a `parameter_list`.
|
||||
It is an error for a `parameter_list` to be empty.
|
||||
|
||||
Record parameters cannot use `ref`, `out` or `this` modifiers (but `in` and `params` are allowed).
|
||||
|
||||
|
@ -385,7 +384,7 @@ For a record:
|
|||
|
||||
### Deconstruct
|
||||
|
||||
A positional record synthesizes a public void-returning instance method called Deconstruct with an out
|
||||
A positional record with at least one parameter synthesizes a public void-returning instance method called Deconstruct with an out
|
||||
parameter declaration for each parameter of the primary constructor declaration. Each parameter
|
||||
of the Deconstruct method has the same type as the corresponding parameter of the primary
|
||||
constructor declaration. The body of the method assigns each parameter of the Deconstruct method
|
||||
|
|
Loading…
Reference in a new issue