[Issue 7315] New: 'out' parameters should be covariant

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 18 15:17:25 PST 2012


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 at puremagic.com
        ReportedBy: timon.gehr at gmx.ch


--- Comment #0 from timon.gehr at gmx.ch 2012-01-18 15:17:24 PST ---
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: -------


More information about the Digitalmars-d-bugs mailing list