[Issue 10195] New: auto type inference on method override
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue May 28 13:58:17 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10195
Summary: auto type inference on method override
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: SebastianGraf at t-online.de
--- Comment #0 from Sebastian Graf <SebastianGraf at t-online.de> 2013-05-28 13:58:15 PDT ---
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.
--
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