www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7315] New: 'out' parameters should be covariant

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

           Summary: 'out' parameters should be covariant
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: timon.gehr gmx.ch



The following code should compile:
class A{
    void foo(out A a){
        a=new A;
    }
}
class B:A{
    override void foo(out B b){
        b=new B;
    }
}

void main(){
    A a;
    B b = new B;
    b.foo(a);
}

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