[TYPES] Why cannot declare a super type dynamically?

Xuhui Li xhli06 at 163.com
Sun May 26 21:27:26 EDT 2019


Dear All,


As far as I know, the existing type systems allow the subtyping being declared in the defintion of the sub types but forbid the super type being declared after the subtype . For example, class A extends B. However, if a new type C is declared and it is found that conceputually C should be a supertype of A (assume that the fields of C don't occur in A but an injection of the fields can be defined) , we cannot declare A extends C after A has been already defined. Why cannot this happen?  Will dynamically introducing a supertype threaten the safety of existing type system?


Thanks for your attention.


Best Regards


Xuhui


More information about the Types-list mailing list