Re: [TYPES] Why cannot declare a super type dynamically?

Jeremy Siek <[email protected]>
Newsgroups gmane.comp.science.types
Message-ID <[email protected]>
[ The Types Forum, http://lists.seas.upenn.edu/mailman/listinfo/types-list ]

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 <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.