Covariant specification

  • Authors:
  • David L. Shang

  • Affiliations:
  • -

  • Venue:
  • ACM SIGPLAN Notices
  • Year:
  • 1994

Quantified Score

Hi-index 0.00

Visualization

Abstract

Covariant specification is the process in a subclass to narrow the varying scope of an instance variable, or the varying scope of the input or output interface of an operation which has already been specified in the superclass. Covariant specification has been considered problematic and many object-oriented languages have restrictions on it. Several proposals have been put forth in order to achieve a type safe convariant specification, but none can be said a complete solution. Problems arise from type intra-dependency: the component type depends on its enclosing type, which has not been fully recognized so far.The type system described in this paper can well reflect the type intra-dependency, and hence gain a type-safe convariant specification. The keynote of our approach is to generalize the concept of constrained parameterized class, which encapsulates detailed information that can give a natural description of type intra-dependency, and makes it possible to incorporate a static type check of the dependency into a compiler.