D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7219 - valid overrides with type qualifiers rejected
Summary: valid overrides with type qualifiers rejected
Status: RESOLVED DUPLICATE of issue 3075
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other All
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2012-01-04 09:30 UTC by timon.gehr
Modified: 2013-11-26 23:00 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-04 09:30:04 UTC
With DMD 2.057, all three overrides fail:

class A{
    void foo(immutable(int)[] x){}
    immutable(int)[] bar(immutable(int)[] x){return x;}
    immutable(int) qux(immutable(int) y){return y;}
}
class B: A{
    override void foo(const(int)[] x){}
    override inout(int)[] bar(inout(int)[] x){return x;}
    override int qux(int y){return y;}
}

The code should compile.
Comment 1 yebblies 2013-11-26 23:00:40 UTC
Parameter contravariance again.

*** This issue has been marked as a duplicate of issue 3075 ***