Recursive attribute for virtual functions?

arturg var.spool.mail700 at gmail.com
Tue Mar 27 22:19:52 UTC 2018


On Tuesday, 27 March 2018 at 21:25:33 UTC, ag0aep6g wrote:
> On 03/27/2018 11:10 PM, 12345swordy wrote:
>> Shouldn't it give a warning then?
>
> I wouldn't mind a warning, or even an error. Putting both @safe 
> and @system directly on a function is an error, too.

shouldn't it create a overload?
for example this fails:

class A
{
     void talk()@safe {}
}

class B : A
{
     alias talk = A.talk;
     void talk()@system {}
}

but this works:

class A
{
     void talk() {}
}

class B : A
{
     alias talk = A.talk;
     void talk(int) {}
}

this works also:

class C
{
     void talk()@system {}
     void talk()@safe {}
}


More information about the Digitalmars-d mailing list