Is there a way to call methods in a parent class? Even if the child
class overloads the method definition?
Take a look at this code:
class baseClass {
public void doSomething(int x) {
return x+1;
}
}
class derivedClass: baseClass {
public void doSomething(int x) {
x *=2;
return baseClass.doSomething(x);
}
}
I haven't seen anything in the D spec that hints at this kind of
functionality. Is this currently possible, and I'm just not aware of
it? If it's not possible, is there any good reason why we couldn't add
this to the spec?

Is there a way to call methods in a parent class? Even if the child
class overloads the method definition?
Take a look at this code:
class baseClass {
public void doSomething(int x) {
return x+1;
}
}
class derivedClass: baseClass {
public void doSomething(int x) {
x *=2;
return baseClass.doSomething(x);
}
}
I haven't seen anything in the D spec that hints at this kind of
functionality. Is this currently possible, and I'm just not aware of
it? If it's not possible, is there any good reason why we couldn't add
this to the spec?

Aha. Fantastic. This really ought to be documented on the
"functions.html" page or the "classes.html" page (which mentions using
"super" to call parent-class constructors, but not other methods) on
the digital mars website.
--Benji
On Wed, 13 Aug 2003 16:05:00 +0100, "Mike Wynn"
<mike.wynn l8night.co.uk> wrote: