Re: D interface bug?

2019-03-29 Thread Alex via Digitalmars-d-learn
On Saturday, 30 March 2019 at 00:44:31 UTC, Alex wrote: On Saturday, 30 March 2019 at 00:06:23 UTC, H. S. Teoh wrote: On Fri, Mar 29, 2019 at 11:44:35PM +, Alex via Digitalmars-d-learn wrote: interface iBase { iBase fooBase(iBase); } class cBase : iBase { cBase

Re: D interface bug?

2019-03-29 Thread Alex via Digitalmars-d-learn
On Saturday, 30 March 2019 at 00:06:23 UTC, H. S. Teoh wrote: On Fri, Mar 29, 2019 at 11:44:35PM +, Alex via Digitalmars-d-learn wrote: interface iBase { iBase fooBase(iBase); } class cBase : iBase { cBase fooBase(cBase c) { return c; } } cBase.fooBase should be a valid

Re: D interface bug?

2019-03-29 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Mar 29, 2019 at 11:44:35PM +, Alex via Digitalmars-d-learn wrote: > interface iBase > { > iBase fooBase(iBase); > } > > > class cBase : iBase > { > cBase fooBase(cBase c) { return c; } > > } > > cBase.fooBase should be a valid override of iBase.fooBase because they

Re: D interface bug?

2019-03-29 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 29 March 2019 at 23:44:35 UTC, Alex wrote: > interface iBase > { > iBase fooBase(iBase); > } > > > class cBase : iBase > { > cBase fooBase(cBase c) { return c; } > > } > > cBase.fooBase should be a valid override of iBase.fooBase > because > they are the same type!

D interface bug?

2019-03-29 Thread Alex via Digitalmars-d-learn
interface iBase { iBase fooBase(iBase); } class cBase : iBase { cBase fooBase(cBase c) { return c; } } cBase.fooBase should be a valid override of iBase.fooBase because they are the same type! cBase is a super type so it contains everything iBase contains and maybe