A Modest Proposal: Final class instances

Walter Bright newshound1 at digitalmars.com
Tue May 5 07:04:21 PDT 2009


dsimcha wrote:
> A possible
> solution is, given a class:
> 
> class Foo {
>     // Actual implementation.
> }
> 
> final class FooFinal : Foo{
>     // Dummy that just makes Foo final.
> }

With dmd:

   final class A { }
   class B : A { }

Compiling:

   test.d(2): Error: class test.B cannot inherit from final class A



More information about the Digitalmars-d mailing list