Re: Another, is it a bug?

2015-09-16 Thread Meta via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 03:48:59 UTC, Random D user wrote: Yeah... I guess I was expecting it to overload across class boundaries. I mean there's already a member eat in base class and sub class can't override that since it's got different parameters, and it's a function (can't be

Re: Another, is it a bug?

2015-09-16 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 13:18:51 UTC, Meta wrote: It's the exact same as in Java, and probably C# as well. I don't know if there's any OOP language that overloads methods between the base and super class. https://ideone.com/En5JEc https://ideone.com/aIIrKM No, there's nothing

Re: Another, is it a bug?

2015-09-16 Thread Meta via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 14:08:11 UTC, Kagamin wrote: On Wednesday, 16 September 2015 at 13:18:51 UTC, Meta wrote: It's the exact same as in Java, and probably C# as well. I don't know if there's any OOP language that overloads methods between the base and super class.

Another, is it a bug?

2015-09-15 Thread Random D user via Digitalmars-d-learn
I'm trying to make a base class with get property and a sub class with corresponding set property. The value for the base class is set via constructor. The intuitive way doesn't seem to work and workarounds are unnecessarily ugly (considering you'll sprinkle them all over the codebase).

Re: Another, is it a bug?

2015-09-15 Thread Meta via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 02:59:06 UTC, Random D user wrote: I'm trying to make a base class with get property and a sub class with corresponding set property. The value for the base class is set via constructor. The intuitive way doesn't seem to work and workarounds are unnecessarily

Re: Another, is it a bug?

2015-09-15 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 03:48:59 UTC, Random D user Given that, normally properties are just overloaded methods in D, it's pretty sad classes break this behavior/convention. The D behavior for overloading is different in general: http://dlang.org/hijack.html It basically never

Re: Another, is it a bug?

2015-09-15 Thread Random D user via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 03:17:05 UTC, Meta wrote: Considering Father defines the function `int eat()` and Daughter defines the completely different function `int eat(int)`, it doesn't surprise me. You're not using virtual dispatch when you do `return super.eat` or `d.Father.eat()`,

Re: Another, is it a bug?

2015-09-15 Thread Random D user via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 03:54:34 UTC, Adam D. Ruppe wrote: On Wednesday, 16 September 2015 at 03:48:59 UTC, Random D user Given that, normally properties are just overloaded methods in D, it's pretty sad classes break this behavior/convention. The D behavior for overloading is