Bug 10007 – function overrides but is not covariant

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-04-29T05:20:00Z
Last change time
2013-09-07T22:47:56Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
rswhite4

Comments

Comment #0 by rswhite4 — 2013-04-29T05:20:00Z
---- import std.stdio; struct A { } interface IFoo { void bar(ref const A); } class Foo : IFoo { void bar(ref const A a) { } void bar(const A a) { return this.bar(a); } } ---- prints: Error: function c517.Foo.bar of type void(const(A) a) overrides but is not covariant with c517.IFoo.bar of type void(ref const(A))
Comment #1 by k.hara.pg — 2013-05-07T03:33:18Z
Comment #2 by github-bugzilla — 2013-09-07T22:47:47Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/61e980de3dc57cc9d8502098ea11e5a2b4f1985a fix Issue 10007 - function overrides but is not covariant https://github.com/D-Programming-Language/dmd/commit/fc460eede168cf52879ca41191baf7db1f893569 Merge pull request #1973 from 9rnsr/fix10007 Issue 10007 - function overrides but is not covariant