User loginNavigation |
Dynamic inheritance?Consider class C that inherits from class B in a (statically) typed language. I would like to extend, at runtime, an instance of type B to type C:
B b = new B();
Assert(b is B);
b.Method(); // invokes B.Method()
extend b to C(); // partial constructor for C
Assert(b is B);
Assert(b is C);
b.Method(); // invokes C.Method() override
Is there any reason why this should not be allowed in terms of type safety? If not, what is it called and is there any language out there that supports this? By Gabriel Horvath at 2013-06-29 10:54 | LtU Forum | previous forum topic | next forum topic | other blogs | 3892 reads
|
Browse archives
Active forum topics |
Recent comments
5 weeks 4 days ago
5 weeks 5 days ago
5 weeks 6 days ago
5 weeks 6 days ago
6 weeks 4 days ago
6 weeks 4 days ago
6 weeks 4 days ago
9 weeks 5 days ago
10 weeks 4 days ago
10 weeks 4 days ago