Type reconstruction for coercion polymorphism
Abstract:
The problem addressed in this paper is type reconstruction for programming languages that permit implicit coercions between primitive (base) types. We present an approach to performing type reconstruction in such a situation. If elements of type 1 can be implicitly coerced to elements of type 2, then 1 can be viewed as a subtype of 2, denoted 1 2. We assume that the subtype relations between the primitive types allow the collection of these types to be arranged in a lattice, although in some cases a more general partial order is permitted. Our approach to performing type reconstruction in the presence of subtype relations defined on the collection of primitive types is to translate the problem to the wellstudied problem of performing type reconstruction in the presence of subtype polymorphism where the subtype relation is defined on record types. We define a translation from primitive types to record types, perform type reconstruction (using the standard type reconstruction algorithm), and then translate the types obtained back to types in the original type system.
Citations
| 826 | A theory of type polymorphism in programming – Milner - 1978 |
| 513 | A semantics of multiple inheritance – Cardelli - 1988 |
| 146 | Complete type inference for simple objects – Wand - 1987 |
| 131 | Typechecking records and variants in a natural extension of ML – Rémy - 1989 |
| 122 | Type inference for record concatenation and multiple inheritance – Wand - 1991 |
| 84 | Type inference with subtypes – Fuh, Mishra - 1990 |
| 70 | Type inference for records in a natural extension of ML – R'emy - 1994 |
| 52 | ML with extended pattern matching and subtypes – Jategaonkar, Mitchell - 1988 |
| 27 | Type inference with subtypes – Stansifer - 1988 |
| 26 | Type inference for objects with instance variables and inheritance – Wand - 1989 |
| 2 | Type reconstruction algorithms for object-oriented languages – Wetklow - 1990 |
| 1 | Principal types for object-oriented languages – Hense, Smolka - 1993 |
| 1 | Method reuse in typed object-oriented languages – Stansifer, Wetklow - 1993 |

