www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - abstract classes and interfaces

reply kyle <kbcomm protonmail.com> writes:
I'm attempting Markdown for the first time so forgive me if that 
doesn't go well. Consider the following:

```d
interface A
{
     bool broken();
}

abstract class B : A
{

}

class C : B
{

}

void main()
{
     import std.stdio;
     C test = new C();
     writeln(test);
}

```

DMD compiles this providing no notice that either B or C do not 
implement interface A. Is this how things are supposed to work? 
Thanks.
Sep 27 2021
next sibling parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 9/27/21 12:11 PM, kyle wrote:
 I'm attempting Markdown for the first time so forgive me if that doesn't 
 go well. Consider the following:
 
 ```d
 interface A
 {
      bool broken();
 }
 
 abstract class B : A
 {
 
 }
 
 class C : B
 {
 
 }
 
 void main()
 {
      import std.stdio;
      C test = new C();
      writeln(test);
 }
 
 ```
 
 DMD compiles this providing no notice that either B or C do not 
 implement interface A. Is this how things are supposed to work? Thanks.
That's a regression. In 2.092.1, it reports: ``` onlineapp.d(11): Error: class `onlineapp.C` interface function `bool broken()` is not implemented onlineapp.d(11): Error: class `onlineapp.C` interface function `bool broken()` is not implemented ``` As of 2.093, it no longer errors. -Steve
Sep 27 2021
parent reply Adam D Ruppe <destructionator gmail.com> writes:
On Monday, 27 September 2021 at 16:20:59 UTC, Steven 
Schveighoffer wrote:
 That's a regression. In 2.092.1, it reports:
aye known bug here https://issues.dlang.org/show_bug.cgi?id=21321 maybe once dmd can compile C code we'll fix it so it compiles D code correctly again.
Sep 27 2021
next sibling parent reply kyle <kbcomm protonmail.com> writes:
On Monday, 27 September 2021 at 16:23:49 UTC, Adam D Ruppe wrote:
 On Monday, 27 September 2021 at 16:20:59 UTC, Steven 
 Schveighoffer wrote:
 That's a regression. In 2.092.1, it reports:
aye known bug here https://issues.dlang.org/show_bug.cgi?id=21321 maybe once dmd can compile C code we'll fix it so it compiles D code correctly again.
That'd be great. Long live Beefconf.
Sep 27 2021
parent =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
On 9/27/21 9:30 AM, kyle wrote:

 That'd be great. Long live Beefconf.
I miss it way too often. Gotta have some beet ready for the next BeetConf. :p Ali
Sep 27 2021
prev sibling parent Tejas <notrealemail gmail.com> writes:
On Monday, 27 September 2021 at 16:23:49 UTC, Adam D Ruppe wrote:
 On Monday, 27 September 2021 at 16:20:59 UTC, Steven 
 Schveighoffer wrote:
 That's a regression. In 2.092.1, it reports:
aye known bug here https://issues.dlang.org/show_bug.cgi?id=21321 maybe once dmd can compile C code we'll fix it so it compiles D code correctly again.
Stop roasting Walter and co. lol XD
Sep 27 2021
prev sibling parent Salih Dincer <salihdb hotmail.com> writes:
On Monday, 27 September 2021 at 16:11:31 UTC, kyle wrote:
 DMD compiles this providing no notice...
What is the version of your DMD?
Sep 27 2021