Is it possible to return the subclass from a method of the parent class in dlang?

Christian Köstlin christian.koestlin at gmail.com
Sat Mar 3 00:13:43 UTC 2018


>> class Timer : Thread {
>>    override Timer start() { ... }
>> }
>>
>> https://dlang.org/spec/function.html#virtual-functions
>>
>> (see item 6)
>>
>> -Steve
> Thanks for this.
> It works for me only without the override (with override I get
> Error: function timer.Timer.start does not override any function, did
> you mean to override 'core.thread.Thread.start'?).
This seems to be connected to Thread.start being a final function.



More information about the Digitalmars-d-learn mailing list