Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
June 06, 2019 [Issue 19943] Field base access works for virtual methods | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19943 Basile-z <b2.temp@gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |b2.temp@gmx.com Hardware|x86_64 |All OS|Linux |All --- Comment #1 from Basile-z <b2.temp@gmx.com> --- I see this more as a feature. It is occasionally useful and without that it would painfully hard (as seen in other languages that don't support this, some trickery with delegates and cast must be used) to call a less derived virtual method from a more derived type. A use case is when you derive a class from a framework that you don't control and that its protection attributes or its class hierarchy have flaws. E.g: Some useful things are done in Framework.A, Only a small thing you want to avoid is done in Framework.B but your Own.C must derive from Framework.B because the rest is ok and you don't want to copy and paste 95% of Framework.B -- |
June 06, 2019 [Issue 19943] Field base access works for virtual methods | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19943 --- Comment #2 from FeepingCreature <default_357-line@yahoo.de> --- To me, the problem isn't that you're able to do it from Own.C, the problem is that you're able to do it from random.foo(), a function that is unrelated to the A inheritance hierarchy. -- |
June 06, 2019 [Issue 19943] Field base access works for virtual methods | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19943 --- Comment #3 from Basile-z <b2.temp@gmx.com> --- Okay I see. Maybe that outside this should behave like a cast, which then behaves like you expect, i.e the field can be read but virtual dispatching is not shortcut. -- |
March 21, 2020 [Issue 19943] Field base access works for virtual methods | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19943 Basile-z <b2.temp@gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|b2.temp@gmx.com | -- |
December 17, 2022 [Issue 19943] Field base access works for virtual methods | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19943 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P1 |P3 -- |
Copyright © 1999-2021 by the D Language Foundation