www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6058] New: Contract inheritance causes compiler error

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6058

           Summary: Contract inheritance causes compiler error
           Product: D
           Version: D1
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: mathias.baumann sociomantic.com



2011-05-26 06:32:44 PDT ---
Created an attachment (id=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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 26 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6058


Leandro Lucarella <llucax gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------

          mime type|                            |


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 01 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6058


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|D1                          |D1 & D2



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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 19 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6058


Henning Pohl <henning still-hidden.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |henning still-hidden.de
         Resolution|                            |DUPLICATE



PDT ---
*** This issue has been marked as a duplicate of issue 10479 ***

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