[fpc-pascal] [OT] sealed?
silvioprog
silvioprog at gmail.com
Mon Oct 7 20:38:47 CEST 2013
2013/10/7 Sven Barth <pascaldragon at googlemail.com>
> On 07.10.2013 19:29, silvioprog wrote:
>
>> Hello,
>>
>> I was surfing the internet and came across this structure Delphi:
>>
>>
>> TJSONPair= class sealed(TJSONAncestor)
>>
>>
>> So, what is this?
>>
>
> Simple: You are not allowed to create child classes of sealed classes (the
> compiler enforces this). FPC supports this since 2.4.2.
>
> Regards,
> Sven
Perfect!
It tested it:
TBaseClass = class
end;
TOtherClass = class sealed(TBaseClass)
end;
TFooClass = class(TOtherClass)
end;
and:
unit1.pas(24,32) Error: Cannot create a descendant of the sealed class
"TOtherClass"
It is wonderful, thank you very much Sven! :)
--
Silvio Clécio
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20131007/92cbc7ac/attachment.html>
More information about the fpc-pascal
mailing list