Matching ThisType to subtyping

The notion of ThisType has been proposed to promote typesafe reuse of binary methods and recently extended to mutually recursive definitions. It is well-known, however, that ThisType does not match with subtyping well. In the current type systems, type safety is guaranteed by the sacrifice of subtyping, hence dynamic dispatch. In this paper, we propose two mechanisms, namely, nonheritable methods and local exactization to remedy the mismatch between ThisType and subtyping. We rigorously prove their safety by modeling them in a small calculus.

[1]  Erik Ernst,et al.  Higher-Order Hierarchies , 2003, ECOOP.

[2]  Paul Jolly,et al.  Simple Dependent Types: Concord , 2004 .

[3]  Mirko Viroli,et al.  Variant path types for scalable extensibility , 2007, OOPSLA.

[4]  Kim B. Bruce,et al.  Subtyping Is Not a Good "Match" for Object-Oriented Languages , 1997, ECOOP.

[5]  Ole Lehrmann Madsen,et al.  Object-oriented programming in the BETA programming language , 1993 .

[6]  Andrew C. Myers,et al.  Scalable extensibility via nested inheritance , 2004, OOPSLA.

[7]  Martin Odersky,et al.  Scalable component abstractions , 2005, OOPSLA '05.

[8]  Kim B. Bruce,et al.  LOOJ: Weaving LOOM into Java , 2004, ECOOP.

[9]  Luca Cardelli,et al.  On Binary Methods , 1995, Theory Pract. Object Syst..

[10]  Kim B. Bruce,et al.  Semantics-Driven Language Design: Statically Type-safe Virtual Types in Object-oriented Languages , 1999, MFPS.

[11]  Kim B. Bruce A paradigmatic object-oriented programming language: Design, static typing and semantics , 1994, Journal of Functional Programming.

[12]  Kim B. Bruce,et al.  PolyTOIL: A Type-Safe Polymorphic Object-Oriented Language , 1995, ECOOP.

[13]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[14]  Martin Odersky,et al.  Pizza into Java: translating theory into practice , 1997, POPL '97.

[15]  Kim B. Bruce Some challenging typing issues in object-oriented languages , 2003, WOOD.

[16]  Sophia Drossopoulou,et al.  Tribe: a simple virtual class calculus , 2007, AOSD.

[17]  Philip Wadler,et al.  Featherweight Java: a minimal core calculus for Java and GJ , 1999, OOPSLA '99.

[18]  Mirko Viroli,et al.  Variant parametric types: A flexible subtyping scheme for generics , 2006, ACM Trans. Program. Lang. Syst..

[19]  Martin Odersky,et al.  A Statically Safe Alternative to Virtual Types , 1998, ECOOP.

[20]  Martin Odersky,et al.  Making the future safe for the past: adding genericity to the Java programming language , 1998, OOPSLA '98.

[21]  Erik Ernst,et al.  Family Polymorphism , 2001, ECOOP.

[22]  Gilad Bracha,et al.  Adding wildcards to the Java programming language , 2004, SAC '04.

[23]  Mirko Viroli,et al.  Lightweight family polymorphism , 2008, J. Funct. Program..

[24]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

[25]  Xin Qi,et al.  J&: nested intersection for scalable software composition , 2006, OOPSLA '06.