|
@@ -51,13 +51,13 @@ Destructors interact with inheritance, which was introduced in proposal
|
|
|
|
|
|
|
|
Destructors were discussed in open discussion on these dates:
|
|
Destructors were discussed in open discussion on these dates:
|
|
|
|
|
|
|
|
-- [2021-07-12](https://docs.google.com/document/d/1QCdKQ33rki-kCDrxi8UHy3a36dtW0WdMqpUzluGSrz4/edit?resourcekey=0-bZmNUiueOiH_sysJNqnT9A#heading=h.40jlsrcgp8mr)
|
|
|
|
|
-- [2021-08-30](https://docs.google.com/document/d/105GsfmxOwcZ_iHkCXFnALB7e-_R3IgMpGKfeT84h1mc/edit?resourcekey=0-h3uVHObsJwChVg1MdaWfKQ#heading=h.4dobu6v1cdam)
|
|
|
|
|
-- [2021-10-04](https://docs.google.com/document/d/105GsfmxOwcZ_iHkCXFnALB7e-_R3IgMpGKfeT84h1mc/edit?resourcekey=0-h3uVHObsJwChVg1MdaWfKQ#heading=h.a0rffns9r10n)
|
|
|
|
|
|
|
+- [2021-07-12](https://docs.google.com/document/d/14vAcURDKeH6LZ_TQCMRGpNJrXSZCACQqDy29YH19XGo/edit#heading=h.40jlsrcgp8mr)
|
|
|
|
|
+- [2021-08-30](https://docs.google.com/document/d/1YhwNKLxQsWf8NPVaRm9PvgPmSM3PIK_KlD1gpNuUfwY/edit#heading=h.4dobu6v1cdam)
|
|
|
|
|
+- [2021-10-04](https://docs.google.com/document/d/1YhwNKLxQsWf8NPVaRm9PvgPmSM3PIK_KlD1gpNuUfwY/edit#heading=h.a0rffns9r10n)
|
|
|
discussed not all types being destructible, and that some types are
|
|
discussed not all types being destructible, and that some types are
|
|
|
`TriviallyDestructible`
|
|
`TriviallyDestructible`
|
|
|
-- [2021-10-18](https://docs.google.com/document/d/105GsfmxOwcZ_iHkCXFnALB7e-_R3IgMpGKfeT84h1mc/edit?resourcekey=0-h3uVHObsJwChVg1MdaWfKQ#heading=h.uz59mgk5ezch)
|
|
|
|
|
-- [2022-03-24](https://docs.google.com/document/d/1cRrhRrmaUf2hVi2lFcHsYo2j0jI6t9RGZoYjWhRxp14/edit?resourcekey=0-xWHBEZ8zIqnJiB4yfBSLfA#heading=h.cy8m79pgct1v)
|
|
|
|
|
|
|
+- [2021-10-18](https://docs.google.com/document/d/1YhwNKLxQsWf8NPVaRm9PvgPmSM3PIK_KlD1gpNuUfwY/edit#heading=h.uz59mgk5ezch)
|
|
|
|
|
+- [2022-03-24](https://docs.google.com/document/d/1UelNaT_j61G8rYp6qQZ-biRddTuGcxJtqXxrVbjB9rA/edit#heading=h.cy8m79pgct1v)
|
|
|
|
|
|
|
|
As part of
|
|
As part of
|
|
|
[proposal 777: Inheritance](https://github.com/carbon-language/carbon-lang/pull/777),
|
|
[proposal 777: Inheritance](https://github.com/carbon-language/carbon-lang/pull/777),
|
|
@@ -109,11 +109,11 @@ downsides that we ultimately decided were too large:
|
|
|
type-of-types were implemented.
|
|
type-of-types were implemented.
|
|
|
|
|
|
|
|
This was considered in the open discussions on
|
|
This was considered in the open discussions on
|
|
|
-[2021-08-30](https://docs.google.com/document/d/105GsfmxOwcZ_iHkCXFnALB7e-_R3IgMpGKfeT84h1mc/edit?resourcekey=0-h3uVHObsJwChVg1MdaWfKQ#heading=h.4dobu6v1cdam)
|
|
|
|
|
|
|
+[2021-08-30](https://docs.google.com/document/d/1YhwNKLxQsWf8NPVaRm9PvgPmSM3PIK_KlD1gpNuUfwY/edit#heading=h.4dobu6v1cdam)
|
|
|
and
|
|
and
|
|
|
-[2021-10-18](https://docs.google.com/document/d/105GsfmxOwcZ_iHkCXFnALB7e-_R3IgMpGKfeT84h1mc/edit?resourcekey=0-h3uVHObsJwChVg1MdaWfKQ#heading=h.uz59mgk5ezch).
|
|
|
|
|
|
|
+[2021-10-18](https://docs.google.com/document/d/1YhwNKLxQsWf8NPVaRm9PvgPmSM3PIK_KlD1gpNuUfwY/edit#heading=h.uz59mgk5ezch).
|
|
|
We decided to go with the proposed approach in
|
|
We decided to go with the proposed approach in
|
|
|
-[the open discussion on 2022-03-24](https://docs.google.com/document/d/1cRrhRrmaUf2hVi2lFcHsYo2j0jI6t9RGZoYjWhRxp14/edit?resourcekey=0-xWHBEZ8zIqnJiB4yfBSLfA#heading=h.cy8m79pgct1v).
|
|
|
|
|
|
|
+[the open discussion on 2022-03-24](https://docs.google.com/document/d/1UelNaT_j61G8rYp6qQZ-biRddTuGcxJtqXxrVbjB9rA/edit#heading=h.cy8m79pgct1v).
|
|
|
|
|
|
|
|
### Prevent virtual function calls in destructors
|
|
### Prevent virtual function calls in destructors
|
|
|
|
|
|
|
@@ -137,13 +137,13 @@ transitively calls. We would consider this as a potential future extension. As
|
|
|
noted in the design, this could be achieved by using the `partial` type.
|
|
noted in the design, this could be achieved by using the `partial` type.
|
|
|
|
|
|
|
|
This was considered in the open discussions on
|
|
This was considered in the open discussions on
|
|
|
-[2021-08-30](https://docs.google.com/document/d/105GsfmxOwcZ_iHkCXFnALB7e-_R3IgMpGKfeT84h1mc/edit?resourcekey=0-h3uVHObsJwChVg1MdaWfKQ#heading=h.4dobu6v1cdam)
|
|
|
|
|
|
|
+[2021-08-30](https://docs.google.com/document/d/1YhwNKLxQsWf8NPVaRm9PvgPmSM3PIK_KlD1gpNuUfwY/edit#heading=h.4dobu6v1cdam)
|
|
|
and
|
|
and
|
|
|
-[2021-10-18](https://docs.google.com/document/d/105GsfmxOwcZ_iHkCXFnALB7e-_R3IgMpGKfeT84h1mc/edit?resourcekey=0-h3uVHObsJwChVg1MdaWfKQ#heading=h.uz59mgk5ezch).
|
|
|
|
|
|
|
+[2021-10-18](https://docs.google.com/document/d/1YhwNKLxQsWf8NPVaRm9PvgPmSM3PIK_KlD1gpNuUfwY/edit#heading=h.uz59mgk5ezch).
|
|
|
|
|
|
|
|
### Allow functions to act as destructors
|
|
### Allow functions to act as destructors
|
|
|
|
|
|
|
|
-[We considered, on 2021-08-30](https://docs.google.com/document/d/105GsfmxOwcZ_iHkCXFnALB7e-_R3IgMpGKfeT84h1mc/edit?resourcekey=0-h3uVHObsJwChVg1MdaWfKQ#heading=h.4dobu6v1cdam),
|
|
|
|
|
|
|
+[We considered, on 2021-08-30](https://docs.google.com/document/d/1YhwNKLxQsWf8NPVaRm9PvgPmSM3PIK_KlD1gpNuUfwY/edit#heading=h.4dobu6v1cdam),
|
|
|
how we might support returning a value, for example a failure, from a
|
|
how we might support returning a value, for example a failure, from a
|
|
|
destructor. This would require that the destructor be called explicitly, rather
|
|
destructor. This would require that the destructor be called explicitly, rather
|
|
|
than implicitly as part of a `Allocator.Delete()` call or a variable leaving
|
|
than implicitly as part of a `Allocator.Delete()` call or a variable leaving
|
|
@@ -183,7 +183,7 @@ is particularly concerning if whether a type implements a constraint depends on
|
|
|
which function is the enclosing scope.
|
|
which function is the enclosing scope.
|
|
|
|
|
|
|
|
This was considered in the
|
|
This was considered in the
|
|
|
-[open discussion on 2021-08-30](https://docs.google.com/document/d/105GsfmxOwcZ_iHkCXFnALB7e-_R3IgMpGKfeT84h1mc/edit?resourcekey=0-h3uVHObsJwChVg1MdaWfKQ#heading=h.4dobu6v1cdam).
|
|
|
|
|
|
|
+[open discussion on 2021-08-30](https://docs.google.com/document/d/1YhwNKLxQsWf8NPVaRm9PvgPmSM3PIK_KlD1gpNuUfwY/edit#heading=h.4dobu6v1cdam).
|
|
|
|
|
|
|
|
### Allow multiple conditional destructors
|
|
### Allow multiple conditional destructors
|
|
|
|
|
|
|
@@ -270,7 +270,7 @@ does not have a virtual destructor, but may be pointing to a derived value. We
|
|
|
as part of
|
|
as part of
|
|
|
[proposal 777: Inheritance](https://github.com/carbon-language/carbon-lang/pull/777).
|
|
[proposal 777: Inheritance](https://github.com/carbon-language/carbon-lang/pull/777).
|
|
|
We decided to go with the proposed approach in
|
|
We decided to go with the proposed approach in
|
|
|
-[the open discussion on 2022-03-24](https://docs.google.com/document/d/1cRrhRrmaUf2hVi2lFcHsYo2j0jI6t9RGZoYjWhRxp14/edit?resourcekey=0-xWHBEZ8zIqnJiB4yfBSLfA#heading=h.cy8m79pgct1v).
|
|
|
|
|
|
|
+[the open discussion on 2022-03-24](https://docs.google.com/document/d/1UelNaT_j61G8rYp6qQZ-biRddTuGcxJtqXxrVbjB9rA/edit#heading=h.cy8m79pgct1v).
|
|
|
|
|
|
|
|
#### Don't distinguish safe and unsafe delete operations
|
|
#### Don't distinguish safe and unsafe delete operations
|
|
|
|
|
|
|
@@ -299,7 +299,7 @@ This option was considered in the
|
|
|
#### Allow final destructors
|
|
#### Allow final destructors
|
|
|
|
|
|
|
|
One option we
|
|
One option we
|
|
|
-[considered early on](https://docs.google.com/document/d/1QCdKQ33rki-kCDrxi8UHy3a36dtW0WdMqpUzluGSrz4/edit?resourcekey=0-bZmNUiueOiH_sysJNqnT9A#heading=h.40jlsrcgp8mr)
|
|
|
|
|
|
|
+[considered early on](https://docs.google.com/document/d/14vAcURDKeH6LZ_TQCMRGpNJrXSZCACQqDy29YH19XGo/edit#heading=h.40jlsrcgp8mr)
|
|
|
for extensible classes with non-virtual destructors, was to require the same
|
|
for extensible classes with non-virtual destructors, was to require the same
|
|
|
thing we do from non-virtual methods. That is, require that the implementation
|
|
thing we do from non-virtual methods. That is, require that the implementation
|
|
|
in the base class is appropriate for derived classes. We ultimately decided on a
|
|
in the base class is appropriate for derived classes. We ultimately decided on a
|