[Issue 4855] When a class has private override member function, the function requires no return value type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 12 09:56:17 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4855



--- Comment #2 from Haruki Shigemori <rayerd.wiz at gmail.com> 2010-09-12 09:55:48 PDT ---
Thank you for your reply.
If this characteristic is a design of DMD, I will close this bug report.
What do you think that both look like asymmetry?

import std.stdio;
class Base
{
    int f() {return 0;}
    int g() {return 0;}
}
class Derived : Base
{
    private override /+int+/ f() {return 1;} // accepts
    public  override /+int+/ g() {return 1;} // rejects
}
void main() {}

main.d(10): Error: function main.Derived.g of type () overrides but is not
covariant with main.Base.g of type int()
main.d(10): Error: function main.Derived.g does not override any function

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list