Bug 10195 – auto type inference on method override

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-28T13:58:00Z
Last change time
2013-05-28T13:59:32Z
Assigned to
nobody
Creator
SebastianGraf

Comments

Comment #0 by SebastianGraf — 2013-05-28T13:58:15Z
Overload resolution fails to recognize baz in the following example to be a valid candidate for an override: interface Foo { int baz(); } class Bar : Foo { auto baz() { return cast(int)1; } } pragma(msg, typeof(Foo.baz).stringof); // int() pragma(msg, typeof(Bar.baz).stringof); // int() main.d(8): Error: function foo.Bar.baz of type () overrides but is not covariant with foo.Foo.baz of type int() It seems like auto isn't resolved before the covariance check.
Comment #1 by andrej.mitrovich — 2013-05-28T13:59:32Z
*** This issue has been marked as a duplicate of issue 8318 ***