Build interface from abstract class
arturg
var.spool.mail700 at gmail.com
Tue May 29 20:26:52 UTC 2018
On Tuesday, 29 May 2018 at 19:06:24 UTC, DigitalDesigns wrote:
> On Monday, 28 May 2018 at 22:15:40 UTC, arturg wrote:
>> this might help you,
>> https://dpaste.dzfl.pl/2cf844a11e3f
>>
>> you can use them to generate the functions as strings.
>
> Thanks,
>
> So, the problem I'm having is that I cannot use the generated
> interface for the abstract class because the abstract class
> needs the interface defined. I need to be able to forward
> define the interface then extend it.
>
> D doesn't like this
>
> main.d(10): Error: interface `main.B` base `A` is forward
> referenced
>
> interface A;
> mixin(Generate!(B,A));
> interface B : A
> {
>
> }
>
> abstract class C : B
> {
>
> }
>
would it work if you define the interface but mixin the members?
interface A
{
mixin(InterfaceFromClass!C);
}
More information about the Digitalmars-d-learn
mailing list