Sealed classes - would you want them in D? (v2)

KingJoffrey KingJoffrey at KingJoffrey.com
Thu May 17 07:58:55 UTC 2018


On Thursday, 17 May 2018 at 07:36:40 UTC, arturg wrote:
>
> no, that uses type inferance.
> you have to do
> Animal dog = new Dog;

i tried it... certainly interesting.. thanks.

but, I don't recall in my opening post, saying I'm ok with having 
to create an interface for every class I create, just so I can go 
off and cast each class to that interface ;-)

The sealed attribute would not require me to go to such 
extravagant lengths.

Remember, the idea for discussion is about adding one single 
attribute 'sealed' to the class - the discussion is a lot less 
about 'how can we prevent having to add a this new attribute'.



More information about the Digitalmars-d mailing list