[TYPES] Why cannot declare a super type dynamically?

Jeremy Siek jeremy.siek at gmail.com
Mon May 27 12:34:52 EDT 2019


Dear Xuhui,

Here’s a few related papers from the late 1990’s.

Signatures: A language extension for improving type abstraction and subtype polymorphism in C++
Gerald Baumgartner, Vincent F. Russo
https://doi.org/10.1002/spe.4380250803 <https://doi.org/10.1002/spe.4380250803>

Implementing signatures for C++.
 Gerald Baumgartner and Vincent F. Russo. 
1997. ACM Trans. Program. Lang. Syst. 19, 1 (January 1997), 153-187.
http://dx.doi.org/10.1145/239912.239922 <http://dx.doi.org/10.1145/239912.239922>
 
Safe structural conformance for Java.
by Laufer, Baumgartner, and Russo.
The Computer Journal, 43(6) 2000.

Cheers,
Jeremy

> On May 26, 2019, at 9:27 PM, Xuhui Li <xhli06 at 163.com> wrote:
> 
> [ The Types Forum, http://lists.seas.upenn.edu/mailman/listinfo/types-list ]
> 
> 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