A Proposal for Making Eiffel Type-safe
Open Access
- 1 January 1989
- journal article
- research article
- Published by Oxford University Press (OUP) in The Computer Journal
- Vol. 32 (4) , 305-311
- https://doi.org/10.1093/comjnl/32.4.305
Abstract
Statically type-correct Eiffel programs may produce run-time errors because (1) attributes may be redeclared during inheritance, invalidating assignments in the superclass, (2) a formal method argument type may be restricted in violation of the contravariance of function types, and (3) two applications of a generic class are assumed to conform if the actual arguments conform. The third problem is solved by case analysis on the variance of generic parameters. Declaration by association provides a solution to the first two problems, but is suffers from additional difficulties. Type attributes, or generic parameters with default values, are suggested as a replacement for most cases of declaration by association. The special association type used to express type recursion cannot be explained using type attributes, and its appears to be a truly novel construct for typing object-oriented programs. One consequence of this construct is that Eiffel's conformance hierarchy is a proper subset of its inheritance hierarchy.Keywords
This publication has 0 references indexed in Scilit: