Comment #0 by mathias.baumann — 2011-05-26T06:32:44Z
Created attachment 990
Test Case for Contract Inheritance Error
I am getting the error:
main2.d(18): Error: cast(Object)__result is not an lvalue
When using contracts with inheritance in certain cases. See the attached
test-case for a demonstration of the problem
Comment #1 by clugdbug — 2012-11-19T03:39:07Z
Applies equally to D2, if you add the 'override' keyword:
class Dummy {};
class Super
{
public Object test ()
out (obj) { }
body
{
return new Dummy;
}
}
class Example : Super
{
public override Dummy test ( )
{
return cast(Dummy) super.test;
}
}
void main ( )
{ }
-- D2 --
bug.d(16): Error: cast(const(Object))__result is not an lvalue
Comment #2 by henning — 2013-07-25T07:11:00Z
*** This issue has been marked as a duplicate of issue 10479 ***