[Issue 2853] New: Property overriding problem
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Apr 18 16:57:18 PDT 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2853
Summary: Property overriding problem
Product: D
Version: 1.043
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: d294934 at bsnow.net
class Base
{
int number() { return _number; } // getter
int number(int value) { return _number; } // setter
private:
int _number;
}
class Extension: Base
{
override int number(int value) // override setter
{
return 0;
}
void method()
{
printNumber(this.number); // call base getter
// main.d(21): Error: function main.Extension.number (int) does
not match parameter types ()
// main.d(21): Error: expected 1 arguments, not 0
}
}
Tries call overrided setter
--
More information about the Digitalmars-d-bugs
mailing list