December 06 Re: Struct inheritance | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | On Friday, 6 December 2024 at 01:04:37 UTC, Jonathan M Davis wrote: > class A {} > > class Foo > { > A a; > > alias this = a; > } > ``` Deprecating that was attempted: https://dlang.org/changelog/2.103.0.html#dmd.deprecate-alias-this-for-classes Is deprecation/removal planned for a future edition? |
December 06 Re: Struct inheritance | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Treleaven | On Friday, December 6, 2024 4:42:14 AM MST Nick Treleaven via dip.ideas wrote:
> On Friday, 6 December 2024 at 01:04:37 UTC, Jonathan M Davis
>
> wrote:
> > class A {}
> >
> > class Foo
> > {
> >
> > A a;
> >
> > alias this = a;
> >
> > }
> > ```
>
> Deprecating that was attempted: https://dlang.org/changelog/2.103.0.html#dmd.deprecate-alias-this-for-classe s
>
> Is deprecation/removal planned for a future edition?
Walter seems to think that we cannot remove alias this, but he's quite averse to removing anything at this point, because he's paranoid about breaking code and just generally seems to be against deprecating anything. I don't know what he'll be willing to consider when it comes to alias this and editions. At present, I don't think that much of anything is actually planned for editions in terms of what we're going to change. Ideas have been bandied around, and Walter should be more amenable to breaking changes with editions (since that's at least partially the idea behind them), but we'll have to see what actually happens.
- Jonathan M Davis
|
December 06 Re: Struct inheritance | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | On Friday, 6 December 2024 at 00:06:12 UTC, Jonathan M Davis wrote:
> On Thursday, December 5, 2024 4:36:17 PM MST Derek Fawcus via
>>
>> Is that correct?
>
> The types would be completely independent from one another. It would just be a way to copy the implementation from one to the other.
Yay! This will be the new "private is not private" topic. I expect a deluge of ****posting complaining that struct inheritance is not inheritance.
|
December 06 Re: Struct inheritance | ||||
---|---|---|---|---|
| ||||
Posted in reply to claptrap | On Friday, 6 December 2024 at 12:21:02 UTC, claptrap wrote:
> On Friday, 6 December 2024 at 00:06:12 UTC, Jonathan M Davis wrote:
>> On Thursday, December 5, 2024 4:36:17 PM MST Derek Fawcus via
>>>
>>> Is that correct?
>>
>> The types would be completely independent from one another. It would just be a way to copy the implementation from one to the other.
>
> Yay! This will be the new "private is not private" topic. I expect a deluge of ****posting complaining that struct inheritance is not inheritance.
Then maybe don't refer to it as "struct inheritance", possibly use something like "struct inclusion", or "struct addition". Plus maybe a different syntax, e.g.:
```d
struct A {
}
struct B += A {
}
```
|
Copyright © 1999-2021 by the D Language Foundation