D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7315 - 'out' parameters should be covariant
Summary: 'out' parameters should be covariant
Status: REOPENED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-18 15:17 UTC by timon.gehr
Modified: 2024-12-13 17:57 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description timon.gehr 2012-01-18 15:17:24 UTC
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);
}
Comment 1 dlangBugzillaToGithub 2024-12-13 17:57:44 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18399

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB