Re: function overrides but is not covariant

2013-04-29 Thread Namespace
Nobody knows?

Re: function overrides but is not covariant

2013-04-29 Thread John Colvin
On Sunday, 28 April 2013 at 19:45:41 UTC, Namespace wrote: That surprised me a bit. Is that expected? import std.stdio; struct A { } interface IFoo { void bar(ref const A); } class Foo : IFoo { void bar(ref const A a) { } void

Re: function overrides but is not covariant

2013-04-29 Thread Namespace
Not surprising to me at all. Why would ref be covariant with non-ref? I do not understand the error fully. Why I cannot overload the method in the class with non-ref?

Re: function overrides but is not covariant

2013-04-29 Thread Timon Gehr
On 04/28/2013 09:45 PM, Namespace wrote: That surprised me a bit. Is that expected? 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); } }

Re: function overrides but is not covariant

2013-04-29 Thread John Colvin
On Monday, 29 April 2013 at 09:23:01 UTC, Namespace wrote: Not surprising to me at all. Why would ref be covariant with non-ref? I do not understand the error fully. Why I cannot overload the method in the class with non-ref? Sorry, my mistake, it looks like a bug. Dmd thinks that you're

Re: function overrides but is not covariant

2013-04-29 Thread Ali Çehreli
On 04/28/2013 12:45 PM, Namespace wrote: That surprised me a bit. Is that expected? 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

Re: function overrides but is not covariant

2013-04-29 Thread Namespace
On Monday, 29 April 2013 at 11:40:45 UTC, Timon Gehr wrote: On 04/28/2013 09:45 PM, Namespace wrote: That surprised me a bit. Is that expected? import std.stdio; struct A { } interface IFoo { void bar(ref const A); } class Foo : IFoo { void bar(ref const A a) { } void