Compiler bug?

apz28 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 15 22:21:36 PDT 2017


abstract class A
{
	string _s;
	
@property:
	final string s()
	{
		return _s;
	}
	
	A s(string x)
	{
		_s = x;
		return this;
	}
}

class B : A
{
@property:
	final override A s(string x)
	{
		_s = x;
		return this;
	}
}
	
void main()
{
	B b = new B();
	b.s = "abc";
	assert(b.s == "abc");
}

Compilation output
/d536/f408.d(32): Error: function f408.B.s (string x) is not 
callable using argument types ()


More information about the Digitalmars-d-learn mailing list