August 29, 2005 Inherit from global scope class in nested | ||||
---|---|---|---|---|
| ||||
Why such is disallowed? class Foo { static class Foo { static int x; } static class Bar: .Foo { } } I found workaround, but I'm wondering why the above code doesn't compiles. class Foo { static class Foo { static int x; } alias .Foo gFoo; static class Bar: gFoo { } } |
August 29, 2005 Re: Inherit from global scope class in nested | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ilya Zaitseff | In article <op.sv8t4kggaaezs2@ilya.tec.amursk.ru>, Ilya Zaitseff says... > >Why such is disallowed? > >class Foo { > static class Foo { > static int x; > } > > static class Bar: .Foo > { > } >} > >I found workaround, but I'm wondering why the above code doesn't compiles. > >class Foo { > static class Foo { > static int x; > } > > alias .Foo gFoo; > > static class Bar: gFoo > { > } >} Probably because it is an obscure usage of the dot operator as a global scope operator and it was forgotten to be implemented. Besides, it's probably a mark of bad style. Regards, James Dunne |
Copyright © 1999-2021 by the D Language Foundation