Skip to content

Deconstructors not mentioned #28670

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

Closed
OJacot-Descombes opened this issue Mar 15, 2022 · 3 comments
Closed

Deconstructors not mentioned #28670

OJacot-Descombes opened this issue Mar 15, 2022 · 3 comments

Comments

@OJacot-Descombes
Copy link

Chapter "14.1 General" says:

A class is a data structure that may contain [...], function members (methods, properties, events, indexers, operators, instance constructors, finalizers, and static constructors), [...]

Deconstructors are not mentioned explicitly. Are they covered by "methods" or should they be explicitly listed as function members?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@BillWagner
Copy link
Member

Thanks for reaching out @OJacot-Descombes

In the updates for C# 5.0, the committee decided to standardize on the term "finalizer" rather than "destructor".

We found that using both terms, when the CLI spec used "finalizer" exclusively caused confusion.

I'll close this as answered.

@dotnet-bot dotnet-bot added ⌚ Not Triaged Not triaged and removed ⌚ Not Triaged Not triaged labels Mar 17, 2022
@dotnet-bot dotnet-bot removed the ⌚ Not Triaged Not triaged label Mar 17, 2022
@OJacot-Descombes
Copy link
Author

OJacot-Descombes commented Mar 17, 2022

I am not talking about finalizers (not destructor) but deconstructors like
public void Deconstruct(out string fname, out string mname, out string lname)
(The terms are confusing and used differently in different languages)

@BillWagner
Copy link
Member

Thanks for the correction @OJacot-Descombes I misread it earlier.

The standards committee is finalizing C# 6.0 for ECMA. (Yes, we know and we're working to catch up).

There's a draft PR for version 7 that will include deconstruction at dotnet/csharpstandard#63. The relevant clause is https://github.com/dotnet/csharpstandard/pull/63/files#diff-d9d678d0b42d3c668ebd64159dadfd6188361121feca8fb94fddf8816433cd14R5459

(I'll keep the closed, as the work is already tracked for the C# 7.x standard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants